Re: unite recovery.conf and postgresql.conf

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tatsuo Ishii <ishii@postgresql.org>, "josh@agliodbs.com" <josh@agliodbs.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2011-09-25T17:18:27Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Restructure error handling in reading of postgresql.conf.

Robert Haas <robertmhaas@gmail.com> writes:
> On Sep 24, 2011, at 1:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I don't exactly buy this argument.  If postgresql.conf is hard to
>> machine-edit, why is recovery.conf any easier?

> Because you generally just write a brand-new file, without worrying
> about preserving existing settings. You aren't really editing at all,
> just writing.

If that's all the requirement is, it's trivial to implement.

1. Write your-random-configuration-settings into recovery.conf (or any
other file name you choose ... something named after your tool would be
a better idea).

2. Temporarily append "include recovery.conf" to the end of
postgresql.conf.  Restart server.

3. When done, remove "include recovery.conf" from the end of
postgresql.conf.

The hard cases involve merging user-supplied and tool-supplied settings,
but "let's overwrite recovery.conf in toto" never would have been able
to handle such cases either.

			regards, tom lane