Re: Issues with PL/PGSQL function.. - Mailing list pgsql-general

From Tom Lane
Subject Re: Issues with PL/PGSQL function..
Date
Msg-id 29203.1184636633@sss.pgh.pa.us
Whole thread Raw
In response to Re: Issues with PL/PGSQL function..  ("Shoaib Mir" <shoaibmir@gmail.com>)
List pgsql-general
"Shoaib Mir" <shoaibmir@gmail.com> writes:
> Try using it with 'execute' as that might help...

In current releases you need EXECUTE, else the thing will try to cache a
query plan using the OID of the first instance of the temp table, and
that won't work for subsequent instances.

> OR:
> CREATE TEMP TABLE tblname WITH (OIDS) ON COMMIT DROP AS select * from
> someothertbl;

ON COMMIT DROP won't help, but maybe you could have just one temp table
per session, created with ON COMMIT DELETE ROWS?  Or try TRUNCATE'ing
the table when it already exists.

This will be all better in 8.3, FWIW.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: why postgresql over other RDBMS
Next
From: Gregory Stark
Date:
Subject: Re: why postgresql over other RDBMS