dbTalk Databases Forums  

[BUGS] BUG #1064: work with temporary table in plpgsql function

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1064: work with temporary table in plpgsql function in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1064: work with temporary table in plpgsql function - 01-24-2004 , 02:14 AM







The following bug has been logged online:

Bug reference: 1064
Logged by: Sergey

Email address: serg.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

Reply With Quote
  #2  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] BUG #1064: work with temporary table in plpgsql function - 01-26-2004 , 12:29 PM







Yes, this is an FAQ. Use EXECUTE.

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

PostgreSQL Bugs List wrote:
Quote:
The following bug has been logged online:

Bug reference: 1064
Logged by: Sergey

Email address: serg.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.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.