setof type and later table bug?? - Mailing list pgsql-bugs

From Sergiusz Michalski
Subject setof type and later table bug??
Date
Msg-id bi79c8$nm4$1@nemesis.news.tpi.pl
Whole thread Raw
List pgsql-bugs
Hi!
Guys please help me, it this example I create function sergi() thats return
a rows, and everything is OK, function works well, but
if I execute a SQL query : ALTER TABLE DUPA DROP COLUMN nazwa; or everything
using ALTER TABLE, my function
crashes and error is sth. like query type and function type do not match !
What's it??? How to solve it withought reloading table.

Is it a bug????

PZDR;
Sergiusz.

CREATE TABLE dupa (id int NOT NULL, nazwa varchar(44) NOT NULL, primary
key(id) );
INSERT INTO dupa VALUES(1, 'a');
INSERT INTO dupa VALUES(2, 'b');
INSERT INTO dupa VALUES(3, 'c');
INSERT INTO dupa VALUES(4, 'd');
INSERT INTO dupa VALUES(5, 'e');
INSERT INTO dupa VALUES(6, 'f');
INSERT INTO dupa VALUES(7, 'g');
INSERT INTO dupa VALUES(8, 'h');

CREATE OR REPLACE FUNCTION sergi()
RETURNS SETOF DUPA
AS '
DECLARE
   rec RECORD;
BEGIN
   FOR rec IN SELECT * FROM DUPA LOOP
      RETURN NEXT rec; /* Each RETURN NEXT command returns a row */
   END LOOP;
   RETURN;
END;
' LANGUAGE 'plpgsql';

pgsql-bugs by date:

Previous
From: Robert Creager
Date:
Subject: contrib-global.mk and sql.in question
Next
From: Peter Eisentraut
Date:
Subject: Re: FAQ: 1.13) How do I submit a bug report?