Thread: Bug with plpgsql function after drop column ?
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 -----------------------------