plpgsql & temp table -bug

Started by Szima Gaborover 24 years ago2 messagesbugs
Jump to latest
#1Szima Gabor
sygma@marr.irisz.hu

Hello!

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

createdb test

CREATE DATABASE

createlang plpgsql test
psql test

Welcome to psql, the PostgreSQL interactive terminal.

create function testcnt () returns int4 as '
declare
rp int4;
begin
select count(*) into rp from test_tmp;
return rp;
end;
' language 'plpgsql';

CREATE

test=# create temp table test_tmp (gk int4);
CREATE
test=# insert into test_tmp (gk) values (1);
INSERT 3493039 1
test=# select testcnt();
testcnt
---------
1
(1 row)

test=# drop table test_tmp;
DROP
test=# select testcnt();
ERROR: Relation 3493029 does not exist

:)

Table-OID are cached and not flushed after DROP TABLE?
...

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

PostgreSQL 6.5.3/7.0.3/7.1.12
SuSE 6.4
Linux-2.2.18

-Sygma

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Szima Gabor (#1)
Re: plpgsql & temp table -bug

Szima Gabor writes:

Table-OID are cached and not flushed after DROP TABLE?

Something like that, but what are you expecting?

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter