Re: [GENERAL] About index for temporay table in a plpgsql function

2006-03-17 Thread Emi Lu
Hello, The temporary table will be dropped automatically at the end of the function, right? A temp table will be dropped at the end of the connection. You can reuse it by adding ON COMMIT DELETE ROWS and then check if it exists in your function with this other function:

[GENERAL] About index for temporay table in a plpgsql function

2006-03-16 Thread Emi Lu
Hello, A question about index for temporary table. Postgresql 8.0.1, in a pl/pgsql function: begin ... -- Part I create temporal table t1 as ((select ... from .. left join . where ... ) union (select .. from ... left join ... where ... )); create index idx_t1_cols on t1(col1, col2)

Re: [GENERAL] About index for temporay table in a plpgsql function

2006-03-16 Thread Tony Caduto
Emi Lu wrote: The temporary table will be dropped automatically at the end of the function, right? A temp table will be dropped at the end of the connection. You can reuse it by adding ON COMMIT DELETE ROWS and then check if it exists in your function with this other function: