1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +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

@@ -20,7 +20,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.111 2002/02/26 22:47:05 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.112 2002/03/01 22:45:12 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1112,6 +1112,19 @@ _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
return true;
}
static bool
_equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
{
if (!equalstr(a->dbname, b->dbname))
return false;
if (!equalstr(a->variable, b->variable))
return false;
if (!equal(a->value, b->value))
return false;
return true;
}
static bool
_equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
{
@@ -1289,6 +1302,19 @@ _equalAlterUserStmt(AlterUserStmt *a, AlterUserStmt *b)
return true;
}
static bool
_equalAlterUserSetStmt(AlterUserSetStmt *a, AlterUserSetStmt *b)
{
if (!equalstr(a->user, b->user))
return false;
if (!equalstr(a->variable, b->variable))
return false;
if (!equal(a->value, b->value))
return false;
return true;
}
static bool
_equalDropUserStmt(DropUserStmt *a, DropUserStmt *b)
{
@@ -1988,6 +2014,9 @@ equal(void *a, void *b)
case T_CreatedbStmt:
retval = _equalCreatedbStmt(a, b);
break;
case T_AlterDatabaseSetStmt:
retval = _equalAlterDatabaseSetStmt(a, b);
break;
case T_DropdbStmt:
retval = _equalDropdbStmt(a, b);
break;
@@ -2027,6 +2056,9 @@ equal(void *a, void *b)
case T_AlterUserStmt:
retval = _equalAlterUserStmt(a, b);
break;
case T_AlterUserSetStmt:
retval = _equalAlterUserSetStmt(a, b);
break;
case T_DropUserStmt:
retval = _equalDropUserStmt(a, b);
break;