From: Bruce Momjian <bruce@momjian.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Torsten Förtsch <tfoertsch123@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-general@postgresql.org>
Subject: Re: slightly unexpected result
Date: Wed, 10 Jan 2024 11:18:57 -0500
Message-ID: <ZZ7Dcc3fN71moe3E@momjian.us> (raw)
In-Reply-To: <CAKFQuwZgyTQpNWUqGuHNUQmsU2KC2onDZzxEMSpcQFuqmgZ1_A@mail.gmail.com>
References: <CAKkG4_kM1yuqw1oimYM_fAzsSJqQkejWW5yHqw_WfOng+9Y4TQ@mail.gmail.com>
<ZZ67t031h30F84C4@momjian.us>
<CAKFQuwZgyTQpNWUqGuHNUQmsU2KC2onDZzxEMSpcQFuqmgZ1_A@mail.gmail.com>
On Wed, Jan 10, 2024 at 09:06:31AM -0700, David G. Johnston wrote:
> It is mostly documented.
>
> https://www.postgresql.org/docs/current/queries-with.html#
> QUERIES-WITH-MODIFYING
> """
> Only one of the modifications takes place, but it is not easy (and sometimes
> not possible) to reliably predict which one.
> ...
> In particular avoid writing WITH sub-statements that could affect the same rows
> changed by the main statement or a sibling sub-statement. The effects of such a
> statement will not be predictable.
> """
>
> Yes, an error would be nice, but the effort put forth stops at unpredictable,
> and saying just don't do it.
Oh, good to know. :-)
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Only you can decide what is important to you.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: bruce@momjian.us, david.g.johnston@gmail.com, tfoertsch123@gmail.com
Subject: Re: slightly unexpected result
In-Reply-To: <ZZ7Dcc3fN71moe3E@momjian.us>
References: <CAKkG4_kM1yuqw1oimYM_fAzsSJqQkejWW5yHqw_WfOng+9Y4TQ@mail.gmail.com> <ZZ67t031h30F84C4@momjian.us> <CAKFQuwZgyTQpNWUqGuHNUQmsU2KC2onDZzxEMSpcQFuqmgZ1_A@mail.gmail.com> <ZZ7Dcc3fN71moe3E@momjian.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