pgsql: Add support for not-null constraints on virtual generated column - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Add support for not-null constraints on virtual generated column
Date
Msg-id E1ty9ED-001QT8-2f@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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 <jian.universality@gmail.com>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Reviewed-by: Navneet Kumar <thanit3111@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
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(-)


pgsql-committers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: pgsql: Stablize tests added in 3abe9dc188.
Next
From: Robert Haas
Date:
Subject: pgsql: pg_overexplain: Call previous hooks as appropriate.