mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Add attisinherited column to pg_attribute; use it to guard against
column additions, deletions, and renames that would let a child table get out of sync with its parent. Patch by Alvaro Herrera, with some kibitzing by Tom Lane.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.174 2002/08/29 00:17:04 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.175 2002/08/30 19:23:20 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -430,7 +430,8 @@ ProcessUtility(Node *parsetree,
|
||||
renameatt(relid,
|
||||
stmt->oldname, /* old att name */
|
||||
stmt->newname, /* new att name */
|
||||
interpretInhOption(stmt->relation->inhOpt)); /* recursive? */
|
||||
interpretInhOption(stmt->relation->inhOpt), /* recursive? */
|
||||
false); /* recursing already? */
|
||||
break;
|
||||
case RENAME_TRIGGER:
|
||||
renametrig(relid,
|
||||
@@ -470,6 +471,7 @@ ProcessUtility(Node *parsetree,
|
||||
*/
|
||||
AlterTableAddColumn(relid,
|
||||
interpretInhOption(stmt->relation->inhOpt),
|
||||
false,
|
||||
(ColumnDef *) stmt->def);
|
||||
break;
|
||||
case 'T': /* ALTER COLUMN DEFAULT */
|
||||
@@ -505,13 +507,13 @@ ProcessUtility(Node *parsetree,
|
||||
&(stmt->subtype));
|
||||
break;
|
||||
case 'D': /* DROP COLUMN */
|
||||
/*
|
||||
* XXX We don't actually recurse yet, but what we should do would be:
|
||||
/*
|
||||
* Recursively drop column from table and,
|
||||
* if requested, from descendants
|
||||
*/
|
||||
AlterTableDropColumn(relid,
|
||||
interpretInhOption(stmt->relation->inhOpt),
|
||||
false,
|
||||
stmt->name,
|
||||
stmt->behavior);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user