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

Josh Berkus <josh@agliodbs.com>

From: Josh Berkus <josh@agliodbs.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Greg Smith <greg@2ndQuadrant.com>, Amit kapila <amit.kapila@huawei.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, 'Fujii Masao' <masao.fujii@gmail.com>, 'Robert Haas' <robertmhaas@gmail.com>
Date: 2013-07-22T23:35:47Z
Lists: pgsql-hackers
All,

Christophe just discovered something with include files which is going
to cause issues with ALTER SYSTEM SET.

So, take as a hypothetical that you use the default postgresql.conf
file, which sets shared_buffers = 32MB.

Instead of editing this file, you do ALTER SYSTEM SET shared_buffers =
'1GB', which updates config/postgresql.auto.conf.

Then you restart PostgreSQL.

Everything is hunky-dory, until a later occasion where you *reload*
postgresql.  Then postgres startup hits the first "shared_buffers=32MB"
(in postgresql.conf), says "I can't change shared buffers on a reload",
and aborts before ever getting to postgresql.auto.conf.

This is a problem that exists now with includes in postgresql.conf, but
having ALTER SYSTEM SET will cause more users to hit it.  Seems like
we'll need to fix it before releasing 9.4.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com