On Fri, 4 Apr 2008 09:13:18 -0700 Shahaf Abileah wrote: > I have a function that creates a temp table and drops it on commit. If > I run the function twice in the same psql interactive session, I get an > error. If I run it twice in two different psql sessions (using the -c > flag), I get no error. Is this expected behavior? If so, why? Create a query in a text string and run the query with EXECUTE. In your case the OIDs are determined during parsing, but in the next function call the temp table is gone away. So you have to make sure the table is dynamically created. Kind regards -- Andreas 'ads' Scherbaum German PostgreSQL User Group European PostgreSQL User Group - Board of Directors