Re: creating a temp table in a function

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: "Raymond O'Donnell" <rod(at)iol(dot)ie>
Cc: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: creating a temp table in a function
Date: 2008-04-04 20:26:08
Message-ID: 20080404202608.GJ12346@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Raymond O'Donnell wrote:
> On 04/04/2008 20:47, Andreas 'ads' Scherbaum 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.
>
> Wasn't this fixed in 8.3? - Is it not the case that you no longer have
> to handle temp tables in plpgsql functions via EXECUTE?

Yes, it should work on 8.3.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-04-04 20:27:43 Re: modules
Previous Message Tom Dunstan 2008-04-04 20:26:07 Re: modules