mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Create an ALTER DEFAULT PRIVILEGES command, which allows users to adjust
the privileges that will be applied to subsequently-created objects. Such adjustments are always per owning role, and can be restricted to objects created in particular schemas too. A notable benefit is that users can override the traditional default privilege settings, eg, the PUBLIC EXECUTE privilege traditionally granted by default for functions. Petr Jelinek
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.438 2009/09/22 23:43:37 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.439 2009/10/05 19:24:38 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2345,6 +2345,17 @@ _copyGrantRoleStmt(GrantRoleStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static AlterDefaultPrivilegesStmt *
|
||||
_copyAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *from)
|
||||
{
|
||||
AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
|
||||
|
||||
COPY_NODE_FIELD(options);
|
||||
COPY_NODE_FIELD(action);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static DeclareCursorStmt *
|
||||
_copyDeclareCursorStmt(DeclareCursorStmt *from)
|
||||
{
|
||||
@@ -3760,6 +3771,9 @@ copyObject(void *from)
|
||||
case T_GrantRoleStmt:
|
||||
retval = _copyGrantRoleStmt(from);
|
||||
break;
|
||||
case T_AlterDefaultPrivilegesStmt:
|
||||
retval = _copyAlterDefaultPrivilegesStmt(from);
|
||||
break;
|
||||
case T_DeclareCursorStmt:
|
||||
retval = _copyDeclareCursorStmt(from);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user