mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
This patch implement the TODO [ALTER DATABASE foo OWNER TO bar].
It was necessary to touch in grammar and create a new node to make home to the new syntax. The command is also supported in E CPG. Doc updates are attached too. Only superusers can change the owner of the database. New owners don't need any aditional privileges. Euler Taveira de Oliveira
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.216 2004/05/26 04:41:35 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.217 2004/05/26 13:56:54 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -234,6 +234,7 @@ check_xact_readonly(Node *parsetree)
|
||||
switch (nodeTag(parsetree))
|
||||
{
|
||||
case T_AlterDatabaseSetStmt:
|
||||
case T_AlterDbOwnerStmt:
|
||||
case T_AlterDomainStmt:
|
||||
case T_AlterGroupStmt:
|
||||
case T_AlterSeqStmt:
|
||||
@@ -675,6 +676,13 @@ ProcessUtility(Node *parsetree,
|
||||
createdb((CreatedbStmt *) parsetree);
|
||||
break;
|
||||
|
||||
case T_AlterDbOwnerStmt:
|
||||
{
|
||||
AlterDbOwnerStmt *stmt = (AlterDbOwnerStmt *) parsetree;
|
||||
AlterDatabaseOwner(stmt->dbname, stmt->uname);
|
||||
}
|
||||
break;
|
||||
|
||||
case T_AlterDatabaseSetStmt:
|
||||
AlterDatabaseSet((AlterDatabaseSetStmt *) parsetree);
|
||||
break;
|
||||
@@ -1303,6 +1311,10 @@ CreateCommandTag(Node *parsetree)
|
||||
tag = "CREATE DATABASE";
|
||||
break;
|
||||
|
||||
case T_AlterDbOwnerStmt:
|
||||
tag = "ALTER DATABASE";
|
||||
break;
|
||||
|
||||
case T_AlterDatabaseSetStmt:
|
||||
tag = "ALTER DATABASE";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user