diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-04-24 02:48:55 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-04-24 02:48:55 +0000 |
commit | 3a96b6cdeb6ea526de8759dd138c5985437c0260 (patch) | |
tree | cf2b1a95e59779679314a9207be42824e2fe9fac /src/backend/tcop/utility.c | |
parent | fbc4b7110fc9cd7096a248e257086974ffeadcc2 (diff) | |
download | postgresql-3a96b6cdeb6ea526de8759dd138c5985437c0260.tar.gz postgresql-3a96b6cdeb6ea526de8759dd138c5985437c0260.zip |
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
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r-- | src/backend/tcop/utility.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 24a1e3d2964..d1d670228ff 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -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; |