From: Tom Lane <tgl@sss.pgh.pa.us>
To: josh@agliodbs.com
Cc: Ludwig Lim <lud_nowhere_man@yahoo.com>
Cc: PostgreSQL Mailing List <pgsql-sql@postgresql.org>
Subject: Re: plpgsql cursors : dynamic or static?
Date: Wed, 23 Oct 2002 14:56:48 -0400
Message-ID: <3204.1035399408@sss.pgh.pa.us> (raw)
In-Reply-To: <200210231121.00113.josh@agliodbs.com>
References: <20021023172118.20960.qmail@web80312.mail.yahoo.com>
<200210231121.00113.josh@agliodbs.com>
Josh Berkus <josh@agliodbs.com> writes:
>> Are cursors in plpgsql dynamic or static?
>>
>> FOR rec in SELECT f1,f2
>> FROM table1 WHERE .... LOOP
>>
>> /* some codes that manipulate table1 */
>> END LOOP;
> Technically speaking, that is not a cursor, even though it serves the same
> purpose.
> I'm pretty sure it's static, but it would be easy to test ... why don't you
> give it a try?
The result definitely will be static in 7.3. I'm not entirely sure
about prior releases: we used to manipulate the current-command counter
in a different way.
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, josh@agliodbs.com, lud_nowhere_man@yahoo.com
Subject: Re: plpgsql cursors : dynamic or static?
In-Reply-To: <3204.1035399408@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