Re: Temporary Tables - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Temporary Tables
Date
Msg-id 20030401165857.Y55556-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Temporary Tables  ("Roman Fail" <rfail@posportal.com>)
List pgsql-general
On Tue, 1 Apr 2003, Roman Fail wrote:

> I've just written a function in PL/pgSQL that creates two temporary
> tables, then drops them at the end.  For each session, the first time
> I run it works great.  The second time I try it from the same session,
> I get this error:
>
> trans=# SELECT * FROM tranddthistory(6, '2003-03-20', '2003-04-05') AS
> (senddate date, day char(3), filename varchar(40), postingdate date,
> systemdate date) ;
> WARNING:  Error occurred while executing PL/pgSQL function tranddthistory
> WARNING:  line 19 at SQL statement
> ERROR:  pg_class_aclcheck: relation 89979461 not found
> trans=#
>
> I feel pretty confident that I'm doing something wrong with the
> temporary tables.  I've read everything I can find in the docs,
> searched the list archives, and come up empty.  Any ideas?

You need to use execute to work with the temporary table.  Otherwise,
it'll save the query plan which will be invalid after the drop/create.


pgsql-general by date:

Previous
From: "Roman Fail"
Date:
Subject: Temporary Tables
Next
From: Bruno Wolff III
Date:
Subject: Re: Earth distance