Re: Per-session data? - Mailing list pgsql-general

From Mike Mascari
Subject Re: Per-session data?
Date
Msg-id 40968CF4.5060805@mascari.com
Whole thread Raw
In response to Re: Per-session data?  (Mike Mascari <mascarm@mascari.com>)
Responses Re: Per-session data?  (Steve Atkins <steve@blighty.com>)
List pgsql-general
I wrote:

> There are three problems with using PostgreSQL temporary tables:
>
> 1. PL/pgSQL will cache the OID of the temporary table that existed when
> it is first parsed, and when that temporary table is dropped and
> recreated later, despite having the same name and structure, you'll get
> an error like:
>
> ERROR:  relation with OID 869140 does not exist
> CONTEXT:  PL/pgSQL function "mytest" line 4 at select into variables
>
> The work-around is to use EXECUTE to build the query string at run-time.

I should point out that if you ensure that you create the temporary
table before invoking the function, the function gets parsed once
after the first invocation at the beginning of the session. So that,
in that instance, it would be okay.

Mike Mascari



pgsql-general by date:

Previous
From: Vikram Kulkarni
Date:
Subject: 7.4.2 Regression tests: test stats loops indefinately...
Next
From: Steve Atkins
Date:
Subject: Re: Per-session data?