Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Garfield Lewis <garfield(dot)lewis(at)lzlabs(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question
Date: 2023-04-24 15:40:28
Message-ID: 201144.1682350828@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Garfield Lewis <garfield(dot)lewis(at)lzlabs(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-04-24 15:43:14 Re: what happens if a failed transaction is not rolled back?
Previous Message Siddharth Jain 2023-04-24 15:37:13 what happens if a failed transaction is not rolled back?