mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Make it possibly to specify GUC params per user and per database.
Create a new catalog pg_db_role_setting where they are now stored, and better encapsulate the code that deals with settings into its realm. The old datconfig and rolconfig columns are removed. psql has gained a \drds command to display the settings. Backwards compatibility warning: while the backwards-compatible system views still have the config columns, they no longer completely represent the configuration for a user or database. Catalog version bumped.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.177 2009/08/27 16:59:38 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.178 2009/10/07 22:14:22 alvherre Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -392,8 +392,6 @@ InitializeSessionUserId(const char *rolename)
|
||||
{
|
||||
HeapTuple roleTup;
|
||||
Form_pg_authid rform;
|
||||
Datum datum;
|
||||
bool isnull;
|
||||
Oid roleid;
|
||||
|
||||
/*
|
||||
@ -470,24 +468,6 @@ InitializeSessionUserId(const char *rolename)
|
||||
AuthenticatedUserIsSuperuser ? "on" : "off",
|
||||
PGC_INTERNAL, PGC_S_OVERRIDE);
|
||||
|
||||
/*
|
||||
* Set up user-specific configuration variables. This is a good place to
|
||||
* do it so we don't have to read pg_authid twice during session startup.
|
||||
*/
|
||||
datum = SysCacheGetAttr(AUTHNAME, roleTup,
|
||||
Anum_pg_authid_rolconfig, &isnull);
|
||||
if (!isnull)
|
||||
{
|
||||
ArrayType *a = DatumGetArrayTypeP(datum);
|
||||
|
||||
/*
|
||||
* We process all the options at SUSET level. We assume that the
|
||||
* right to insert an option into pg_authid was checked when it was
|
||||
* inserted.
|
||||
*/
|
||||
ProcessGUCArray(a, PGC_SUSET, PGC_S_USER, GUC_ACTION_SET);
|
||||
}
|
||||
|
||||
ReleaseSysCache(roleTup);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user