mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Attached is a patch for ALTER TRIGGER RENAME per the above thread. I
left a stub for a future "ALTER RULE RENAME" but did not write that one yet. Bruce, if you want to add my name for for that I'll take it and do it later. Joe Conway
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.150 2002/04/18 20:01:09 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.151 2002/04/24 02:48:55 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -377,23 +377,30 @@ ProcessUtility(Node *parsetree,
|
||||
|
||||
CheckOwnership(stmt->relation, true);
|
||||
|
||||
if (stmt->column == NULL)
|
||||
switch (stmt->renameType)
|
||||
{
|
||||
/*
|
||||
* rename relation
|
||||
*/
|
||||
renamerel(RangeVarGetRelid(stmt->relation, false),
|
||||
stmt->newname);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* rename attribute
|
||||
*/
|
||||
renameatt(RangeVarGetRelid(stmt->relation, false),
|
||||
stmt->column, /* old att name */
|
||||
case RENAME_TABLE:
|
||||
renamerel(RangeVarGetRelid(stmt->relation, false),
|
||||
stmt->newname);
|
||||
break;
|
||||
case RENAME_COLUMN:
|
||||
renameatt(RangeVarGetRelid(stmt->relation, false),
|
||||
stmt->oldname, /* old att name */
|
||||
stmt->newname, /* new att name */
|
||||
interpretInhOption(stmt->relation->inhOpt)); /* recursive? */
|
||||
interpretInhOption(stmt->relation->inhOpt)); /* recursive? */
|
||||
break;
|
||||
case RENAME_TRIGGER:
|
||||
renametrig(RangeVarGetRelid(stmt->relation, false),
|
||||
stmt->oldname, /* old att name */
|
||||
stmt->newname); /* new att name */
|
||||
break;
|
||||
case RENAME_RULE:
|
||||
elog(ERROR, "ProcessUtility: Invalid target for RENAME: %d",
|
||||
stmt->renameType);
|
||||
break;
|
||||
default:
|
||||
elog(ERROR, "ProcessUtility: Invalid target for RENAME: %d",
|
||||
stmt->renameType);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user