From: Tom Lane <tgl@sss.pgh.pa.us>
To: Garfield Lewis <garfield.lewis@lzlabs.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question
Date: Mon, 24 Apr 2023 11:40:28 -0400
Message-ID: <201144.1682350828@sss.pgh.pa.us> (raw)
In-Reply-To: <AM8PR05MB82575DB8983375AA7F5B2120E3679@AM8PR05MB8257.eurprd05.prod.outlook.com>
References: <AM8PR05MB8257D674E098CAD33BF0162CE3619@AM8PR05MB8257.eurprd05.prod.outlook.com>
<3705358.1682190174@sss.pgh.pa.us>
<AM8PR05MB82575DB8983375AA7F5B2120E3679@AM8PR05MB8257.eurprd05.prod.outlook.com>
Garfield Lewis <garfield.lewis@lzlabs.com> writes:
> DECLARE cur0 SCROLL CURSOR FOR SELECT * FROM t0 FOR UPDATE;
> psql:curs.pgs:4: ERROR: DECLARE SCROLL CURSOR ... FOR UPDATE is not supported
> DETAIL: Scrollable cursors must be READ ONLY.
Ah. Yeah, I don't think anyone is contemplating changing that.
Scrollable cursors with side effects would have unpleasant semantic
issues about when do the side-effects happen, and can they happen
multiple times (or, perhaps, not at all if you never read all of
the query output)? FOR UPDATE would be slightly less messy than
other kinds of side-effects, since it's idempotent; but only slightly.
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-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, garfield.lewis@lzlabs.com
Subject: Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question
In-Reply-To: <201144.1682350828@sss.pgh.pa.us>
References: <AM8PR05MB8257D674E098CAD33BF0162CE3619@AM8PR05MB8257.eurprd05.prod.outlook.com> <3705358.1682190174@sss.pgh.pa.us> <AM8PR05MB82575DB8983375AA7F5B2120E3679@AM8PR05MB8257.eurprd05.prod.outlook.com> <201144.1682350828@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