Remove arbitrary ALTER TABLE .. ADD COLUMN restriction.
Robert Haas <rhaas@postgresql.org>
Remove arbitrary ALTER TABLE .. ADD COLUMN restriction. The previous coding prevented ALTER TABLE .. ADD COLUMN from being used with a non-NULL default in situations where the table's rowtype was being used elsewhere. But this is a completely arbitrary restriction since you could do the same operation in multiple steps (add the column, add the default, update the table). Inspired by a patch from Noah Misch, though I didn't use his code.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/tablecmds.c | modified | +5 −3 |
| src/test/regress/expected/rowtypes.out | modified | +6 −3 |
| src/test/regress/sql/rowtypes.sql | modified | +6 −2 |