From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Marko Tiikkaja <marko@joh.to>
Cc: eugene.pliskin@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17689: Two UPDATE operators in common table expressions (CTE) perform not as expected
Date: Fri, 18 Nov 2022 13:53:14 -0500
Message-ID: <2251431.1668797594@sss.pgh.pa.us> (raw)
In-Reply-To: <20221118170557.3ndokzwhilygtfq7@alvherre.pgsql>
References: <20221118170557.3ndokzwhilygtfq7@alvherre.pgsql>
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2022-Nov-18, Marko Tiikkaja wrote:
>> This is a documented limitation:
>>> Trying to update the same row twice in a single statement is not
>>> supported.
> I wonder if we should try to detect the case, and raise an error instead
> of it resulting in undefined behavior.
My recollection is that that is really fallout from an ancient and
intentional executor behavior, that we have to ignore multiple updates
in order to not get into infinite loops. See comment about the
"Halloween problem" in nodeLockRows.c. (I'm pretty sure there were once
more comments about that, somewhere closer to ExecUpdate/ExecDelete ---
this all dates back to Berkeley.)
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, marko@joh.to, eugene.pliskin@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17689: Two UPDATE operators in common table expressions (CTE) perform not as expected
In-Reply-To: <2251431.1668797594@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