Skip to content

fix(restore): ensure trailing newline before appending to postgresql.conf#93

Merged
passcod merged 1 commit into
mainfrom
fix-restore-conf-newline
Jul 5, 2026
Merged

fix(restore): ensure trailing newline before appending to postgresql.conf#93
passcod merged 1 commit into
mainfrom
fix-restore-conf-newline

Conversation

@passcod

@passcod passcod commented Jul 5, 2026

Copy link
Copy Markdown
Member

When restoring, the init script strips old logging/config settings from the snapshot's postgresql.conf with sed, then appends replacements with echo ... >>.

If the snapshot's postgresql.conf had no trailing newline, the first appended setting merged onto the last existing line — e.g. timezone = 'UTC'log_destination = 'stderr' — corrupting the config and breaking the restore.

Fix: append a blank line before the settings block. Postgres ignores blank lines and this config is throwaway per-restore, so an unconditional newline is the simplest safe fix.

🤖 Generated with Claude Code

…conf

If a snapshot's postgresql.conf had no trailing newline, the first
appended setting (log_destination) merged onto the last existing line,
corrupting the config and breaking the restore. Append a blank line
first; Postgres ignores it and the config is throwaway anyway.
@passcod passcod merged commit 0f3b8c7 into main Jul 5, 2026
19 checks passed
@passcod passcod deleted the fix-restore-conf-newline branch July 5, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant