From: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
---|---|
To: | Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | PL/PGSQL and drop/create table |
Date: | 2005-09-07 11:51:05 |
Message-ID: | 431ED429.9080501@sigaev.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
# create table foo ( bar int );
CREATE TABLE
# create or replace function func (int)
returns int as
$$
DECLARE
IID alias for $1;
CNT int;
BEGIN
select into CNT count(*) from foo where bar = IID;
RETURN CNT;
END;
$$
language plpgsql;
CREATE FUNCTION
# select func(1);
func
------
0
(1 row)
# drop table foo;
DROP TABLE
# create table foo ( bar int );
CREATE TABLE
# select func(1);
ERROR: relation with OID 16628 does not exist
CONTEXT: SQL statement "SELECT count(*) from foo where bar = $1 "
PL/pgSQL function "func" line 5 at select into variables
After reconnecting to database all is ok. Is it supposed behaviour?
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/
From | Date | Subject | |
---|---|---|---|
Next Message | Patrick Welche | 2005-09-07 12:35:59 | Re: inet increment with int |
Previous Message | Christopher Kings-Lynne | 2005-09-07 09:07:42 | Re: Testing for a shared library |