1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Add ALTER VIEW ... RENAME TO, and a RENAME TO clause to ALTER SEQUENCE.

Sequences and views could previously be renamed using ALTER TABLE, but
this was a repeated source of confusion for users. Update the docs,
and psql tab completion. Patch from David Fetter; various minor fixes
by myself.
This commit is contained in:
Neil Conway
2007-07-03 01:30:37 +00:00
parent a1587e41ae
commit a55898131e
12 changed files with 184 additions and 26 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/alter.c,v 1.23 2007/03/26 16:58:38 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/alter.c,v 1.24 2007/07/03 01:30:36 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@ -83,6 +83,8 @@ ExecRenameStmt(RenameStmt *stmt)
break;
case OBJECT_TABLE:
case OBJECT_SEQUENCE:
case OBJECT_VIEW:
case OBJECT_INDEX:
case OBJECT_COLUMN:
case OBJECT_TRIGGER:
@ -96,6 +98,8 @@ ExecRenameStmt(RenameStmt *stmt)
switch (stmt->renameType)
{
case OBJECT_TABLE:
case OBJECT_SEQUENCE:
case OBJECT_VIEW:
case OBJECT_INDEX:
{
/*
@ -113,7 +117,7 @@ ExecRenameStmt(RenameStmt *stmt)
aclcheck_error(aclresult, ACL_KIND_NAMESPACE,
get_namespace_name(namespaceId));
renamerel(relid, stmt->newname);
renamerel(relid, stmt->newname, stmt->renameType);
break;
}
case OBJECT_COLUMN: