Fix table rewrites that include a column without a default

Enterprise / PostgreSQL - Andres Freund [anarazel.de] - 10 October 2019 05:00 EDT

In c2fe139c201c I made ATRewriteTable() use tuple slots. Unfortunately I did not notice that columns can be added in a rewrite that do not have a default, when another column is added/altered requiring one.

Initialize columns to NULL again, and add tests.

Bug: #16038

93765bd956 Fix table rewrites that include a column without a default.
src/backend/commands/tablecmds.c | 10 +++++++
src/test/regress/expected/alter_table.out | 47 ++++++++++++++++++++++++++++++
src/test/regress/sql/alter_table.sql | 48 +++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+)

Upstream: git.postgresql.org


  • Share