Re: BUG #1064: work with temporary table in plpgsql function

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL Bugs List <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #1064: work with temporary table in plpgsql function
Date: 2004-01-26 18:26:54
Message-ID: 200401261826.i0QIQsj15238@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Yes, this is an FAQ. Use EXECUTE.

---------------------------------------------------------------------------

PostgreSQL Bugs List wrote:
>
> The following bug has been logged online:
>
> Bug reference: 1064
> Logged by: Sergey
>
> Email address: serg(dot)z(at)list(dot)ru
>
> PostgreSQL version: 7.4
>
> Operating system: FreeBSD
>
> Description: work with temporary table in plpgsql function
>
> Details:
>
> If a followed function is called more once inside one session, then occured
> this error:
>
> ERROR: relation with OID 19990 does not exist
> CONTEXT: PL/pgSQL function "test_temp" line 3 at SQL statement
>
>
> TEST FUNCTION:
>
> CREATE OR REPLACE FUNCTION public.test_temp()
> RETURNS int4 AS
> 'begin
> create temporary table itable(id int4, name varchar(100));
> insert into itable values(1, \'test\');
> drop table itable;
>
> return 0;
> end;
> '
> LANGUAGE 'plpgsql' VOLATILE;
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tanya Mamedalin 2004-01-26 19:59:26 Re: signal 11
Previous Message Tom Lane 2004-01-26 17:00:28 Re: 7.4.xx regression