Re: archive modules - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: archive modules
Date
Msg-id 20221013182408.GA1551106@nathanxps13
Whole thread Raw
In response to Re: archive modules  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: archive modules  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Oct 13, 2022 at 03:25:27PM +0530, Bharath Rupireddy wrote:
> The intent here looks reasonable to me. However, why should the user
> be able to set both archive_command and archive_library in the first
> place only to later fail in LoadArchiveLibrary() per the patch? IMO,
> the check_hook() is the right way to disallow any sorts of GUC
> misconfigurations, no?

There was some discussion upthread about using the GUC hooks to enforce
this [0].  In general, it doesn't seem to be a recommended practice.  One
basic example of the problems with this approach is the following:

  1. Set archive_command and leave archive_library unset and restart
     the server.
  2. Unset archive_command and set archive_library and call 'pg_ctl
     reload'.

After these steps, you'll see the following log messages:

    2022-10-13 10:58:42.112 PDT [1562524] LOG:  received SIGHUP, reloading configuration files
    2022-10-13 10:58:42.114 PDT [1562524] LOG:  cannot set "archive_library" when "archive_command" is specified
    2022-10-13 10:58:42.114 PDT [1562524] DETAIL:  Only one of "archive_library" or "archive_command" can be
specified.
    2022-10-13 10:58:42.114 PDT [1562524] LOG:  parameter "archive_command" changed to ""
    2022-10-13 10:58:42.114 PDT [1562524] LOG:  configuration file "/home/nathan/pgdata/postgresql.conf" contains
errors;unaffected changes were applied
 

[0] https://postgr.es/m/20220914200305.GA2984249%40nathanxps13

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Zhihong Yu
Date:
Subject: remove redundant memset() call
Next
From: Andres Freund
Date:
Subject: Re: proposal: possibility to read dumped table's name from file