pg_backup_ctl
pg_backup_ctl copied to clipboard
setup mode could warn if current value and configuration file value are different before editing
I was trying to be a bit too clever and set "wal_level = hot_standby" in postgresql.conf, followed by pg_backup_ctl setup.
To my surprise, it downgraded the setting in postgresql.conf to 'archive'! Turns out pg_backup_ctl queries the server for the current setting, and edits postgresql.conf based on that (the server still had "minimal" as current setting).
I am not sure what the best course of action is here, but possibly sanity checking postgresql.conf against the current value and aborting if they don't match could work (seeing that you only need to parse very few settings, none of which with units or arbitrary values, and archive_command seems to get unconditionally overwritten everytime anyway)