Allow ALTER TABLE name {OF type | NOT OF}.
Robert Haas <rhaas@postgresql.org>
Allow ALTER TABLE name {OF type | NOT OF}.
This syntax allows a standalone table to be made into a typed table,
or a typed table to be made standalone. This is possibly a mildly
useful feature in its own right, but the real motivation for this
change is that we need it to make pg_upgrade work with typed tables.
This doesn't actually fix that problem, but it's necessary
infrastructure.
Noah Misch
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/alter_table.sgml | modified | +26 −0 |
| src/backend/commands/tablecmds.c | modified | +260 −17 |
| src/backend/parser/gram.y | modified | +17 −0 |
| src/backend/parser/parse_utilcmd.c | modified | +1 −21 |
| src/include/commands/tablecmds.h | modified | +2 −0 |
| src/include/nodes/parsenodes.h | modified | +2 −0 |
| src/test/regress/expected/alter_table.out | modified | +38 −0 |
| src/test/regress/sql/alter_table.sql | modified | +30 −0 |