Re: Temporary tables

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Raymond O'Donnell" <rod(at)iol(dot)ie>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Temporary tables
Date: 2006-01-13 18:13:04
Message-ID: 20060113181304.GA98249@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 13, 2006 at 05:23:42PM -0000, Raymond O'Donnell wrote:
> The first time I call "select testfunc();", I get 0 as expected.
> However, subsequent calls return an error:
>
> ERROR: relation with OID 80845 does not exist
> CONTEXT: SQL statement "SELECT count(*) from TestTbl"
> PL/pgSQL function "testfunc" line 7 at select into variables
>
> Why should the temporary table be there the first time around and not
> after that, since it's created anew at the start of the function?

See 'Why do I get "relation with OID ##### does not exist" errors
when accessing temporary tables in PL/PgSQL functions?' in the FAQ:

http://www.postgresql.org/docs/faqs.FAQ.html#item4.19

See also numerous past discussions in the list archives.

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jaime Casanova 2006-01-13 18:19:31 Re: PostgreSQL Top 10 Wishlist
Previous Message Joshua D. Drake 2006-01-13 17:53:54 Re: Plans for 8.2?