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.universal...@gmail.com> Reviewed-by: Xuneng Zhou <xunengz...@gmail.com> Reviewed-by: Navneet Kumar <thanit3...@gmail.com> Reviewed-by: Álvaro Herrera <alvhe...@alvh.no-ip.org> Discussion: https://postgr.es/m/cacjufxharqysbdkwfmvk+d1tphqwwtxwn15cmuuatyx3xhq...@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(-)