Re: Proposal for Allow postgresql.conf values to be changed via SQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal for Allow postgresql.conf values to be changed via SQL
Date
Msg-id 10478.1352307229@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal for Allow postgresql.conf values to be changed via SQL  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Proposal for Allow postgresql.conf values to be changed via SQL
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> On Wed, Nov 7, 2012 at 5:19 AM, Amit Kapila <amit.kapila@huawei.com> wrote:
>> However there is one more point which I am not able to clearly make out is
>> how to write into file that contains
>> all configuration parameters changed by SQL.

> Perhaps you can look at pg_settings, to see if the current setting is
> from the .auto file. If it is, then that's where it came from and it
> should be written back there. If it's something else, that's not where
> it came from.

Note that the whole point of the one-value-per-file approach is to not
have to figure this out.

I'm not sure that the above approach works anyway --- for instance, the
"current setting" might be a SET LOCAL result, in which case you still
don't know anything about what the appropriate thing to put into the
file is.  I think there are probably also race conditions with cases
where somebody else just changed some other setting but your session
hasn't absorbed it yet.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Extend libpq to support mixed text and binary results
Next
From: Magnus Hagander
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL