aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2011-01-27 08:35:34 -0500
committerRobert Haas <rhaas@postgresql.org>2011-01-27 08:35:34 -0500
commita40b1e0bf32b1da46c1baa9bc7da87f207cd37d8 (patch)
tree3d8364805c7d4ba24c055682e3c443ebe8cda15f /src/backend
parent81c48aeaa8fd34f90ab6d6f1d56564d34ac4aa59 (diff)
downloadpostgresql-a40b1e0bf32b1da46c1baa9bc7da87f207cd37d8.tar.gz
postgresql-a40b1e0bf32b1da46c1baa9bc7da87f207cd37d8.zip
Restore ALTER TABLE .. ADD COLUMN w/DEFAULT restriction.
This reverts commit a06e41deebdf74b8b5109329dc75b2e9d9057962 of 2011-01-26. Per discussion, this behavior is not wanted, as it would need to change if we ever made composite types support DEFAULT.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/commands/tablecmds.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 8fa9d7fa7f1..1ecba027855 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -142,7 +142,6 @@ typedef struct AlteredTableInfo
List *newvals; /* List of NewColumnValue */
bool new_notnull; /* T if we added new NOT NULL constraints */
bool new_changeoids; /* T if we added/dropped the OID column */
- bool new_changetypes; /* T if we changed column types */
Oid newTableSpace; /* new tablespace; 0 means no change */
/* Objects to rebuild after completing ALTER TYPE operations */
List *changedConstraintOids; /* OIDs of constraints to rebuild */
@@ -3379,14 +3378,14 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode)
}
/*
- * If we change column data types or add/remove OIDs, the operation has to
- * be propagated to tables that use this table's rowtype as a column type.
+ * If we need to rewrite the table, the operation has to be propagated to
+ * tables that use this table's rowtype as a column type.
*
* (Eventually this will probably become true for scans as well, but at
* the moment a composite type does not enforce any constraints, so it's
* not necessary/appropriate to enforce them just during ALTER.)
*/
- if (tab->new_changetypes || tab->new_changeoids)
+ if (newrel)
find_composite_type_dependencies(oldrel->rd_rel->reltype,
RelationGetRelationName(oldrel),
NULL);
@@ -6432,7 +6431,6 @@ ATPrepAlterColumnType(List **wqueue,
newval->expr = (Expr *) transform;
tab->newvals = lappend(tab->newvals, newval);
- tab->new_changetypes = true;
}
else if (tab->relkind == RELKIND_FOREIGN_TABLE)
{