Re: BUG #18531: err when using 'current of' with incremental COMMIT - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18531: err when using 'current of' with incremental COMMIT
Date
Msg-id 3167932.1721059660@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18531: err when using 'current of' with incremental COMMIT  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> That combine 'current of' and 'commit' at one loop is bad idea?

Yeah, that's not going to work.  The first COMMIT auto-holds the
cursor [1], and after that there is not an active cursor query for
the WHERE CURRENT OF to refer to.  Even if that data were somehow
retained, the COMMIT would have dropped the tuple locks taken by
the cursor query, so that the semantics would be a lot squishier
than you'd want.

The discussion at [1] fails to mention that there are any such
gotchas implicit in the auto-hold behavior, so I added a little
bit of text [2].

            regards, tom lane

[1] https://www.postgresql.org/docs/current/plpgsql-transactions.html
[2] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=a0899c0a97d19b0c330ff885af4b78b3e7efb100



pgsql-bugs by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: libpq: unexpected return code from PQexecParams with a DO INSTEAD rule present
Next
From: alvherre
Date:
Subject: Re: BUG #18371: There are wrong constraint residues when detach hash partiton concurrently