Fix table rewrites that include a column without a default.
Andres Freund <andres@anarazel.de>
Fix table rewrites that include a column without a default. 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 Reported-By: anonymous Author: Andres Freund Discussion: https://postgr.es/m/16038-5c974541f2bf6749@postgresql.org Backpatch: 12, where the bug was introduced in c2fe139c201c
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/tablecmds.c | modified | +10 −0 |
| src/test/regress/expected/alter_table.out | modified | +47 −0 |
| src/test/regress/sql/alter_table.sql | modified | +48 −0 |
Discussion
- BUG #16038: Alter table - SegFault 4 messages · 2019-10-04 → 2019-10-10