Error working with Temporary Sequences in plpgsql in 8.1 (8.0 works fine) - Mailing list pgsql-hackers

From Daniel Schuchardt
Subject Error working with Temporary Sequences in plpgsql in 8.1 (8.0 works fine)
Date
Msg-id dqivrp$2ok5$1@news.hub.org
Whole thread Raw
Responses Re: Error working with Temporary Sequences in plpgsql in 8.1 (8.0 works fine)  (Jaime Casanova <systemguards@gmail.com>)
List pgsql-hackers
Hi,

here is a testcase:

CREATE OR REPLACE FUNCTION testseq() RETURNS void AS
$BODY$
BEGINCREATE TEMP SEQUENCE test;PERFORM testseq1();DROP SEQUENCE test;RETURN;
END; $BODY$ LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION testseq() OWNER TO postgres;


CREATE OR REPLACE FUNCTION testseq1() RETURNS void AS
$BODY$
DECLARE I INTEGER;
BEGINI:= nextval('test');RETURN;
END; $BODY$ LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION testseq1() OWNER TO postgres;


SELECT testseq();

-- this works fine.

SELECT testseq();


ERROR:  could not open relation with OID 21152
CONTEXT:  PL/pgSQL function "testseq1" line 3 at assignment
SQL statement "SELECT  testseq1()"
PL/pgSQL function "testseq" line 3 at perform



Greetings,

Daniel.


pgsql-hackers by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Bad estimate on LIKE matching
Next
From: "Magnus Hagander"
Date:
Subject: Re: Docs off on ILIKE indexing?