Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Andres Freund <andres(at)2ndquadrant(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Date: 2013-08-20 14:41:44
Message-ID: CAA4eK1JnrAuuWBsOVXSqCLyMAAd0iP5VLXT+YomPyxkACSOgdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 20, 2013 at 7:51 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> * Amit Kapila (amit(dot)kapila16(at)gmail(dot)com) wrote:
>> Wouldn't it be complicated to handle this way rather then by having
>> include directive.
>
> You misunderstood. I was suggesting a setup along these lines:
>
> postgresql.conf:
> # include = 'auto.conf' # Disabled by default
>
> auto.conf:
> ####################################################
> # MANAGED BY ALTER SYSTEM -- DO NOT MODIFY BY HAND
> ####################################################
>
> # auto.conf not processed unless included by postgresql.conf
> # If included by postgresql.conf, then this will turn on the
> # ALTER SYSTEM command.
> enable_alter_system = on
>
> Which would give us the ability to independently turn on/off ALTER
> SYSTEM from including auto.conf.

So let me try to explain what I understood from above:

1. enable_alter_system a new GUC whose default value =off.
2. Alter System will check this variable and return error (not
allowed), if this parameter is off.
3. Now if user enables include directive in postgresql.conf, it will
enable Alter System as value of
enable_alter_system is on.
4. User can run Alter System command to disable Alter System
"enable_alter_system = off".
Now even though include directive is enabled, but new Alter System
commands will not work, however
existing parameter's take into effect on restart/sighup.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-08-20 14:44:49 Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Previous Message Stephen Frost 2013-08-20 14:21:48 Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])