Skip site navigation (1) Skip section navigation (2)

Re: another idea for changing global configuration settings from SQL

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: another idea for changing global configuration settings from SQL
Date: 2013-01-15 13:53:30
Message-ID: 50F55F5A.3050207@gmx.net (view raw or flat)
Thread:
Lists: pgsql-hackers
On 11/15/12 12:53 PM, Peter Eisentraut wrote:
> We already have the ability to store in pg_db_role_setting configuration
> settings for
> 
> specific user, specific database
> specific user, any database
> any user, specific database
> 
> The existing infrastructure would also support
> 
> any user, any database (= all the time)
> 
> All you'd need is to add
> 
> ApplySetting(InvalidOid, InvalidOid, relsetting, PGC_S_$SOMETHING);
> 
> in postinit.c, and have some SQL command to modify this setting.

Here is a patch for that.

The internals are straightforward.  Actually, we might want to refactor
this a bit later, unifying the AlterRoleSet and AlterDatabaseSet parse
nodes and the functions that do the work, because it's really all the same.

The SQL level interface is a bit odd.  The existing facilities are

ALTER ROLE / SET
ALTER DATABASE / SET
ALTER ROLE / IN DATABASE / SET

Since the original design somehow considered roles to be superior to
databases in this regard, I added the global setting as ALTER ROLE ALL
SET ..., but that's obviously arbitrary.  Most other variants would
probably be much more invasive, though.


Attachment: pg-alter-role-all-set.patch
Description: text/plain (9.5 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2013-01-15 14:05:57
Subject: Teaching pg_receivexlog to follow timeline switches
Previous:From: Greg StarkDate: 2013-01-15 13:35:57
Subject: Re: [PATCH] COPY .. COMPRESSED

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group