Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 62B29476048 for ; Wed, 23 Oct 2002 14:56:54 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id B0EE4475E88 for ; Wed, 23 Oct 2002 14:56:53 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g9NIunhR003205; Wed, 23 Oct 2002 14:56:49 -0400 (EDT) To: josh@agliodbs.com Cc: Ludwig Lim , PostgreSQL Mailing List Subject: Re: plpgsql cursors : dynamic or static? In-reply-to: <200210231121.00113.josh@agliodbs.com> References: <20021023172118.20960.qmail@web80312.mail.yahoo.com> <200210231121.00113.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Wed, 23 Oct 2002 11:21:00 -0700" Date: Wed, 23 Oct 2002 14:56:48 -0400 Message-ID: <3204.1035399408@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/312 X-Sequence-Number: 10029 Josh Berkus 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