Thread: plpgsql & temp table -bug

plpgsql & temp table -bug

From
Szima Gabor
Date:
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

Re: plpgsql & temp table -bug

From
Peter Eisentraut
Date:
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