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

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.98 2002/02/19 20:11:18 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.99 2002/03/01 22:45:15 petere Exp $
*
*
*-------------------------------------------------------------------------
@ -35,6 +35,7 @@
#include "storage/sinval.h"
#include "storage/smgr.h"
#include "utils/fmgroids.h"
#include "utils/guc.h"
#include "utils/portal.h"
#include "utils/relcache.h"
#include "utils/syscache.h"
@ -70,6 +71,10 @@ static bool ThereIsAtLeastOneUser(void);
*
* This is also a handy place to fetch the database encoding info out
* of pg_database, if we are in MULTIBYTE mode.
*
* To avoid having to read pg_database more times than necessary
* during session startup, this place is also fitting to set up any
* database-specific configuration variables.
* --------------------------------
*/
static void
@ -132,6 +137,25 @@ ReverifyMyDatabase(const char *name)
dbform->encoding);
#endif
/*
* Set up datbase-specific configuration variables.
*/
if (IsUnderPostmaster)
{
Datum datum;
bool isnull;
datum = heap_getattr(tup, Anum_pg_database_datconfig,
RelationGetDescr(pgdbrel), &isnull);
if (!isnull)
{
ArrayType *a;
a = (ArrayType *) pg_detoast_datum((struct varlena *)datum);
ProcessGUCArray(a, PGC_S_DATABASE);
}
}
heap_endscan(pgdbscan);
heap_close(pgdbrel, AccessShareLock);
}