pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: dzja112@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18531: err when using 'current of' with incremental COMMIT
Date: Mon, 15 Jul 2024 12:07:40 -0400
Message-ID: <3167932.1721059660@sss.pgh.pa.us> (raw)
In-Reply-To: <18531-c6dddd33b8555fd2@postgresql.org>
References: <18531-c6dddd33b8555fd2@postgresql.org>

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=a0899c0a97d19b0c330ff885af4b78b3e...





view thread (2+ messages)

Message-ID: <3167932.1721059660@sss.pgh.pa.us>
Permalink:  ../3167932.1721059660@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3167932.1721059660@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dzja112@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18531: err when using 'current of' with incremental COMMIT
  In-Reply-To: <3167932.1721059660@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