public inbox for [email protected]
help / color / mirror / Atom feedFrom: Peter Eisentraut <[email protected]>
To: [email protected]
Subject: pgsql: Add support for not-null constraints on virtual generated column
Date: Fri, 28 Mar 2025 12:54:29 +0000
Message-ID: <[email protected]> (raw)
Add support for not-null constraints on virtual generated columns
This was left out of the original patch for virtual generated columns
(commit 83ea6c54025).
This just involves a bit of extra work in the executor to expand the
generation expressions and run a "IS NOT NULL" test against them.
There is also a bit of work to make sure that not-null constraints are
checked during a table rewrite.
Author: jian he <[email protected]>
Reviewed-by: Xuneng Zhou <[email protected]>
Reviewed-by: Navneet Kumar <[email protected]>
Reviewed-by: Álvaro Herrera <[email protected]>
Discussion: https://postgr.es/m/CACJufxHArQysbDkWFmvK+D1TPHQWWTxWN15cMuUaTYX3xhQXgg@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cdc168ad4b22ea4183f966688b245cabb5935d1f
Modified Files
--------------
src/backend/catalog/heap.c | 10 --
src/backend/commands/indexcmds.c | 10 +-
src/backend/commands/tablecmds.c | 71 ++++++--
src/backend/executor/execMain.c | 220 ++++++++++++++++++------
src/backend/parser/parse_utilcmd.c | 14 --
src/include/executor/executor.h | 4 +
src/include/nodes/execnodes.h | 6 +
src/test/regress/expected/generated_virtual.out | 90 ++++++++--
src/test/regress/sql/generated_virtual.sql | 54 +++++-
9 files changed, 360 insertions(+), 119 deletions(-)
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgsql: Add support for not-null constraints on virtual generated column
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox