Re: Resetting recovery target parameters in pg_createsubscriber
Alexander Korotkov <aekorotkov@gmail.com>
From: Alexander Korotkov <aekorotkov@gmail.com>
To: Alena Vinter <dlaaren8@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>,
Michael Paquier <michael@paquier.xyz>, Ilyasov Ian <ianilyasov@outlook.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-11-03T21:27:59Z
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 →
-
pg_createsubscriber: Improve handling of automated recovery configuration
- 639352d904c8 19 (unreleased) landed
On Mon, Oct 27, 2025 at 2:22 PM Alena Vinter <dlaaren8@gmail.com> wrote: > Michael, thank you for outlining your alternative approach. > After rethinking the current patch state with a clearer vision, I realized that simply truncating the postgresql.auto.conf file is sufficient. All modifications made by pg_createsubscriber in this file are append-only, so truncation reliably restores it to its original state without adding extra logic. This keeps the patch small and clean. > > For older versions using recovery.conf, the situation differs — since that file is fully rewritten during recovery setup, we instead restore the previously saved original file using a durable rename. > > Regarding debugging: the contents are not entirely lost. pg_createsubscriber already prints the new recovery configuration as debug output, so the full parameter set remains visible in the logs for inspection when needed. My point is that adding include directives isn't needed, as we already have debug output, and, moreover, they aren't applied to recovery.conf. I have rechecked this. It appears that pg_createsubscriber writes the recovery configuration to the output and only in verbose mode. So, it's far no guaranteed that this information would be accessible. One may run pg_createsubscriber not in verbose mode or don't save its output. I suggest we should re-implement this in a way Michael proposed [1]: save the configuration to pg_createsubscriber.conf.old file. Links. 1. https://www.postgresql.org/message-id/aOZOJ8p8LEcw0SpH%40paquier.xyz ------ Regards, Alexander Korotkov Supabase