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

Re: another idea for changing global configuration settings from SQL

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: another idea for changing global configuration settings from SQL
Date: 2012-11-15 22:08:47
Message-ID: CABUevEwM5A2F3eLUHZrSD0adDrZLWyAMzgfz4Q_3t8LGP0nwGw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Nov 15, 2012 at 6:53 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> Independent of the discussion of how to edit configuration files from
> SQL, I had another idea how many of the use cases for this could be handled.
>
> 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.




> The only thing you couldn't handle that way are SIGHUP settings, but the
> often-cited use cases work_mem, logging, etc. would work.

How hard would it be to make it work for SIGHUP? I can see how it
would be impossible to handle things like POSTMASTER, but SIGHUP seems
like it should be doable somehow?


> There would also be the advantage that pg_dumpall would save these settings.
>
> Thoughts?

I like it. Not as a replacement for the other facility, but as another
way of doing it. And I'd expect it could be the "main way" for manual
changes, but tools would still need access to the other way of course.

We probably need to enhance pg_settings to tell the user *where* the
setting came from whe nit's set this way. In fact, we need this
already, since it can be hard to track down...

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


In response to

Responses

pgsql-hackers by date

Next:From: Peter GeogheganDate: 2012-11-15 22:25:55
Subject: Re: Index only scans wiki page
Previous:From: Tom LaneDate: 2012-11-15 21:58:23
Subject: Re: add -Wlogical-op to standard compiler options?

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