From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Vitaly Ustinov <vitaly@ustinov.ca>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: Generated column is not updated (Postgres 13)
Date: Wed, 19 May 2021 21:18:29 -0400
Message-ID: <3568085.1621473509@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZaFiiGphgJsJgV0tUkaA_Z2zQXodvWkx9enR7hjHRmKQ@mail.gmail.com>
References: <CAM_DEiWR2DPT6U4xb-Ehigozzd3n3G37ZB1+867zbsEVtYoJww@mail.gmail.com>
<3513055.1621461801@sss.pgh.pa.us>
<CAKFQuwZaFiiGphgJsJgV0tUkaA_Z2zQXodvWkx9enR7hjHRmKQ@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> FWIW I can definitely see where the OP is coming from with this - the
> expression at first blush, if one assumes PostgreSQL can handle the
> nuances, seems like a perfectly reasonable semantic way to express the
> programmer's desire. Combined with the fact it used to work makes me want
> to lean toward keeping it working even if it takes come code hackery.
I dunno, I think it "used to work" only for exceedingly small values
of "work". For me, the given test case hits the same assertion failure
in all versions back to v12, which is unsurprising because the code in
ATRewriteTable is about the same.
Also, considering only the table-rewrite code path is a mistake.
The fundamental problem here is that the behavior is ill-defined and
necessarily implementation-dependent; which makes it likely that other
code paths behave inconsistently with ALTER TABLE ADD COLUMN.
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, david.g.johnston@gmail.com, vitaly@ustinov.ca, pgsql-bugs@lists.postgresql.org, peter.eisentraut@enterprisedb.com
Subject: Re: Generated column is not updated (Postgres 13)
In-Reply-To: <3568085.1621473509@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