Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A8F0A9FA280 for ; Wed, 20 Dec 2006 05:09:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 22444-01 for ; Wed, 20 Dec 2006 05:08:57 -0400 (AST) X-Greylist: delayed 00:06:32.531587 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id B65139FA0EF for ; Wed, 20 Dec 2006 05:08:59 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from bitoek.uni-bayreuth.de (bti0x1.bitoek.uni-bayreuth.de [132.180.112.2]) by svr4.postgresql.org (Postfix) with ESMTP id 2357C5AF8AE for ; Wed, 20 Dec 2006 09:02:25 +0000 (GMT) Received: from [132.180.112.27] (bti0x027.bitoek.uni-bayreuth.de [132.180.112.27]) by bitoek.uni-bayreuth.de (8.13.3/8.12.7) with ESMTP id kBK92Mww000434 for ; Wed, 20 Dec 2006 10:02:22 +0100 Message-ID: <4588FC1E.6080709@bayceer.uni-bayreuth.de> Date: Wed, 20 Dec 2006 10:02:22 +0100 From: Stefan Holzheu User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.13) Gecko/20060411 X-Accept-Language: de, en MIME-Version: 1.0 To: ADMIN Subject: Bug with plpgsql function after drop column ? X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/278 X-Sequence-Number: 24070 Hi I just encountered a reproducable bug with plpgsql function "return next" after drop column: create table test ( id int not null primary key ); insert into test values (1); create or replace function get_test(int) returns setof test as 'declare rec record; begin for rec in select * from test where id=$1 loop return next rec; end loop; return; end;' Language 'plpgsql'; select * from get_test(1); alter table test add name text; select * from get_test(1); /* FEHLER: wrong record type supplied in RETURN NEXT KONTEXT: PL/pgSQL function "get_test" line 5 at return next works after recreate of function */ alter table test drop column name; select * from get_test(1); /* FEHLER: wrong record type supplied in RETURN NEXT KONTEXT: PL/pgSQL function "get_test" line 5 at return next DOES NOT works after recreate of function!!!!!! PostgreSQL 8.1.3 Workaround is to drop/recreate the table or (what was easier in our case) dump/restore database. Is it a known known? Regards Stefan Holzheu -- ----------------------------- Dr. Stefan Holzheu Tel.: 0921/55-5720 Fax.: 0921/55-5709 BayCEER EDV und Datenbanken Universitaet Bayreuth D-95440 Bayreuth -----------------------------