Everyone has their own style, unfortunately, on how they edit postgresql.conf. Some like to uncomment specific values and edit them at the point they appear in the default file, some like to tack overrides onto the end… and some do a mixture of those (don’t do that).
My personal preference is to leave everything in the default file commented, and include an overrides file (postgresql.local.conf). That way, I have an easy reference for what the defaults are, and minimum changes when a new version of postgresql.conf lands (you do know that checkpoint_segments is obsolete in 9.5, and you can’t specify it, right?). It’s easy for me to see what I’ve changed, since I can just consult that one included file.
I highly recommend this. But whatever you do, don’t do the “some things in the middle, some things at the end,” please. The next person to edit the file will thank you.
Comments
Dan Langille · 16 February 2016
I can't find documentation on postgresql.local.confDan Langille · 16 February 2016
Oh... include files http://www.postgresql.org/docs/9.4/static/config-setting.html#CONFIG-INCLUDESXof · 16 February 2016
It's just the postgresql.confincludefacility:include 'postgresql.local.conf'Andrew Dunstan · 16 February 2016
I'm a big fan of the postgresql.local.conf approach.par-t · 25 February 2016
Great piece of information! May I reference part of this on my blog if I post a backlink to this webpage? Thx.frank church · 1 March 2016
I had no idea this existed. In which version was it first implemented?Xof · 1 March 2016
The include directive? That's been there for a while; 9.x at least.