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

Andres Freund <andres@2ndquadrant.com>

From: Andres Freund <andres@2ndquadrant.com>
To: Greg Stark <stark@mit.edu>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Fujii Masao <masao.fujii@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Amit Kapila <amit.kapila@huawei.com>, Dimitri Fontaine <dimitri@2ndquadrant.fr>, pgsql-hackers@postgresql.org, Josh Berkus <josh@agliodbs.com>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2013-08-01T15:06:30Z
Lists: pgsql-hackers
Hi,

On 2013-08-01 15:40:22 +0100, Greg Stark wrote:
> Why isn't it enough to just dump out all variables with a source of alter
> system to a text file? You can either have a single global lock around that
> operation or write it to a new file and move it into place.

It saves you from several complications:
* No need to iterate over all GUCs, figuring out which come from which
  source, when writing out the file.
* Less logic required when writing out a value, since you have an
  acceptable input ready.
* No need to make sure the autogenerated file is written out in the same
  order when adding/changing a setting (to make sure you can
  diff/version control it sensibly)
* No locking necessary, without locking concurrent changes can vanish.
* Way easier to delete a setting if it ends up stopping postgres from
  starting.


Greetings,

Andres Freund

PS: .oO(quoting?)

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services