Re: Issues with PL/PGSQL function..

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
Cc: excalibur(at)acceswave(dot)ca, PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Issues with PL/PGSQL function..
Date: 2007-07-17 01:43:53
Message-ID: 29203.1184636633@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Shoaib Mir" <shoaibmir(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2007-07-17 03:12:05 Re: why postgresql over other RDBMS
Previous Message Bruce Momjian 2007-07-17 00:38:16 Re: why postgresql over other RDBMS