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: Martijn van Oosterhout <kleptog(at)svana(dot)org>, 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-22 03:36:22
Message-ID: CAA4eK1KTQe=XOisc53sp-q9Wd3sJAipf5rJrxz0S+K0E0_7mFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 21, 2013 at 8:22 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> Martijn,
>
> * Martijn van Oosterhout (kleptog(at)svana(dot)org) wrote:
>> ISTM you want some kind of hybrid setting like:
>>
>> #include_system auto.conf
>>
>> which simultaneously does three things:
>>
>> 1. Sets the enable_alter_system flag
>> 2. Indicates the file to use
>> 3. Indicates the priority of the setting re other settings.
>>
>> Comment it out, ALTER SYSTEM stop working. Put it back and it's
>> immediately clear what it means. And the user can control where the
>> settings go.
>
> Yeah, that's certainly an interesting idea. I might call it
> 'auto_conf_file auto.conf' to avoid the '#include' concern and to
> perhaps clarify that it's more than just a regular 'include'.

This can resolve the problem of whether to read auto file rather
cleanly, so the idea is:

Enable/Disable reading of auto file
-----------------------------------------------------
a. Have a new include in postresql.conf
#include_auto_conf_file postgresql.auto.conf
as it is a special include, we can read this file relative to data
directory.

Enable/Disable Alter System command
-----------------------------------------------------------
This can be achieved in 3 ways:
a. Check before executing Alter System if include directive is
disabled, then just issue a warning to user and proceed with command.
b. Check before executing Alter System if include directive is
disabled, then just issue an error and stop.
c. Have a new guc enable_alter_system which will behave as described
in my previous mail and below:
>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 PostgreSQL - Hans-Jürgen Schönig 2013-08-22 05:39:41 Re: Backup throttling
Previous Message Noah Misch 2013-08-22 03:24:09 Re: CAST Within EXCLUSION constraint