1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

User and database-specific session defaults for run-time configuration

variables.  New commands ALTER DATABASE ... SET and ALTER USER ... SET.
This commit is contained in:
Peter Eisentraut
2002-03-01 22:45:19 +00:00
parent 851f766115
commit 1aac2c852a
29 changed files with 812 additions and 48 deletions

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.164 2002/03/01 06:01:18 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.165 2002/03/01 22:45:11 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -2245,6 +2245,20 @@ _copyCreatedbStmt(CreatedbStmt *from)
return newnode;
}
static AlterDatabaseSetStmt *
_copyAlterDatabaseSetStmt(AlterDatabaseSetStmt *from)
{
AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
if (from->dbname)
newnode->dbname = pstrdup(from->dbname);
if (from->variable)
newnode->variable = pstrdup(from->variable);
Node_Copy(from, newnode, value);
return newnode;
}
static DropdbStmt *
_copyDropdbStmt(DropdbStmt *from)
{
@ -2427,6 +2441,20 @@ _copyAlterUserStmt(AlterUserStmt *from)
return newnode;
}
static AlterUserSetStmt *
_copyAlterUserSetStmt(AlterUserSetStmt *from)
{
AlterUserSetStmt *newnode = makeNode(AlterUserSetStmt);
if (from->user)
newnode->user = pstrdup(from->user);
if (from->variable)
newnode->user = pstrdup(from->variable);
Node_Copy(from, newnode, value);
return newnode;
}
static DropUserStmt *
_copyDropUserStmt(DropUserStmt *from)
{
@ -2845,6 +2873,9 @@ copyObject(void *from)
case T_CreatedbStmt:
retval = _copyCreatedbStmt(from);
break;
case T_AlterDatabaseSetStmt:
retval = _copyAlterDatabaseSetStmt(from);
break;
case T_DropdbStmt:
retval = _copyDropdbStmt(from);
break;
@ -2884,6 +2915,9 @@ copyObject(void *from)
case T_AlterUserStmt:
retval = _copyAlterUserStmt(from);
break;
case T_AlterUserSetStmt:
retval = _copyAlterUserSetStmt(from);
break;
case T_DropUserStmt:
retval = _copyDropUserStmt(from);
break;