1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +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:
Bruce Momjian
2004-05-26 13:57:04 +00:00
parent d0b4399d81
commit cfbfdc557d
11 changed files with 128 additions and 14 deletions

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.455 2004/05/26 04:41:29 neilc Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.456 2004/05/26 13:56:51 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -152,6 +152,7 @@ static void doNegateFloat(Value *v);
VariableResetStmt VariableSetStmt VariableShowStmt
ViewStmt CheckPointStmt CreateConversionStmt
DeallocateStmt PrepareStmt ExecuteStmt
AlterDbOwnerStmt
%type <node> select_no_parens select_with_parens select_clause
simple_select
@@ -486,7 +487,8 @@ stmtmulti: stmtmulti ';' stmt
;
stmt :
AlterDatabaseSetStmt
AlterDbOwnerStmt
| AlterDatabaseSetStmt
| AlterDomainStmt
| AlterGroupStmt
| AlterSeqStmt
@@ -3918,6 +3920,15 @@ opt_equal: '=' {}
*
*****************************************************************************/
AlterDbOwnerStmt: ALTER DATABASE database_name OWNER TO UserId
{
AlterDbOwnerStmt *n = makeNode(AlterDbOwnerStmt);
n->dbname = $3;
n->uname = $6;
$$ = (Node *)n;
}
;
AlterDatabaseSetStmt:
ALTER DATABASE database_name SET set_rest
{