Re: Per-session data?

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Mike Mascari <mascarm(at)mascari(dot)com>
Cc: Steve Atkins <steve(at)blighty(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Per-session data?
Date: 2004-05-03 18:18:28
Message-ID: 40968CF4.5060805@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Atkins 2004-05-03 18:25:17 Re: Per-session data?
Previous Message Vikram Kulkarni 2004-05-03 18:17:11 7.4.2 Regression tests: test stats loops indefinately...