From: Tom Lane <tgl@sss.pgh.pa.us>
To: biju.george@ust-global.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6583: for loop cursor
Date: Thu, 12 Apr 2012 10:52:28 -0400
Message-ID: <2849.1334242348@sss.pgh.pa.us> (raw)
In-Reply-To: <E1SIFo4-00025a-H3@wrigleys.postgresql.org>
References: <E1SIFo4-00025a-H3@wrigleys.postgresql.org>
biju.george@ust-global.com writes:
> The following bug has been logged on the website:
> Bug reference: 6583
> Logged by: Biju George
> Email address: biju.george@ust-global.com
> PostgreSQL version: 8.4.0
> Operating system: Linux
> Description:
> Just this simple code throws below error --
> CREATE OR REPLACE FUNCTION my_temp_func(v_acc_type integer)
> RETURNS void AS
> $BODY$
> declare
> v_cur cursor (acc_num integer) is select pid from public.my_trade_table
> where acc_type = acc_num;
> begin
> for record_var in v_cur(v_acc_type) loop
> raise notice 'ID is %',record_var.id;
> end loop;
> end;
> $BODY$
> LANGUAGE plpgsql;
Works for me in 8.4.11 (after correcting record_var.id -> record_var.pid
at line 6). Maybe you need to update to some more recent version than
8.4.0.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, biju.george@ust-global.com
Subject: Re: BUG #6583: for loop cursor
In-Reply-To: <2849.1334242348@sss.pgh.pa.us>
References: <E1SIFo4-00025a-H3@wrigleys.postgresql.org> <2849.1334242348@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox