Hi,
the test case below runs fine for me if the function name is not instreq and
returns an error if it is.
Regards.
Balazs
CREATE TABLE aaa (
instreq_id integer
);
INSERT INTO aaa (instreq_id) VALUES (223);
INSERT INTO aaa (instreq_id) VALUES (224);
INSERT INTO aaa (instreq_id) VALUES (225);
INSERT INTO aaa (instreq_id) VALUES (226);
INSERT INTO aaa (instreq_id) VALUES (227);
INSERT INTO aaa (instreq_id) VALUES (228);
INSERT INTO aaa (instreq_id) VALUES (229);
CREATE OR REPLACE FUNCTION instreq(OUT instreq_id integer)
RETURNS SETOF integer AS
$BODY$
DECLARE
rec record;
BEGIN
FOR rec IN
Select instreq.instreq_id From aaa instreq
LOOP
instreq_id =rec.instreq_id;
RETURN NEXT;
End Loop;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100
ROWS 1000;
On Mon, Oct 12, 2009 at 4:15 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Balazs Klein" <Balazs.Klein@gmail.com> writes:
> > On 8.4.1 on windows XP running the function gives an error message
> > (Undefined column: 7 ERROR: record "rec" has no field "instreq_id") wich
> is
> > strange because the underlying query does return that column.
>
> There's really no way to investigate that without a *complete* example.
>
> regards, tom lane
>