Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question - Mailing list pgsql-general

From Tom Lane
Subject Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question
Date
Msg-id 201144.1682350828@sss.pgh.pa.us
Whole thread Raw
In response to Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question  (Garfield Lewis <garfield.lewis@lzlabs.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Siddharth Jain
Date:
Subject: what happens if a failed transaction is not rolled back?
Next
From: Adrian Klaver
Date:
Subject: Re: what happens if a failed transaction is not rolled back?