Fix ALTER TABLE ADD COLUMN to disallow the same column types that are
Tom Lane <tgl@sss.pgh.pa.us>
Fix ALTER TABLE ADD COLUMN to disallow the same column types that are disallowed by CREATE TABLE (eg, pseudo-types); also disallow these types from being introduced by the range-function syntax. While at it, allow CREATE TABLE to create zero-column tables, per recent pghackers discussion. I am back-patching this into 7.3 since failure to disallow pseudo-types is arguably a security hole.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/heap.c | modified | +49 −34 |
| src/backend/commands/tablecmds.c | modified | +4 −6 |
| src/backend/parser/parse_clause.c | modified | +14 −1 |
| src/backend/utils/cache/relcache.c | modified | +4 −3 |
| src/include/catalog/heap.h | modified | +5 −1 |