diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-03 20:57:06 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-03 20:57:06 +0000 |
commit | 7946f77220bb960e7ba5ed2a9dfb84ac3f926b2f (patch) | |
tree | 06e2acfd4ef190bffdfedf4d69669595c9563971 /src/backend/commands/tablecmds.c | |
parent | 89c07b18a6e6bda2508943a3a23569268892b430 (diff) | |
download | postgresql-7946f77220bb960e7ba5ed2a9dfb84ac3f926b2f.tar.gz postgresql-7946f77220bb960e7ba5ed2a9dfb84ac3f926b2f.zip |
Cause ALTER TABLE to perform ALTER COLUMN DROP DEFAULT operations during
the DROP pass rather than the ADD_CONSTR pass. On examining the code I
think this was just an oversight rather than intentional, and it seems
to satisfy the principle of least surprise better than the alternative
solution that was discussed. Add an example to the ref page showing how
to do ALTER TYPE and update the default in one command. Per gripe from
Markus Bertheau that that wasn't possible.
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 3b408b411a6..cd4c4eb2304 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.198 2006/07/31 20:09:00 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.199 2006/08/03 20:57:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2000,7 +2000,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, ATSimplePermissions(rel, true); ATSimpleRecursion(wqueue, rel, cmd, recurse); /* No command-specific prep needed */ - pass = AT_PASS_ADD_CONSTR; + pass = cmd->def ? AT_PASS_ADD_CONSTR : AT_PASS_DROP; break; case AT_DropNotNull: /* ALTER COLUMN DROP NOT NULL */ ATSimplePermissions(rel, false); |