Do not set recovery_target_timeline=current for PostgreSQL < 12. by dwsteele · Pull Request #2533 · pgbackrest/pgbackrest · GitHub
Skip to content

Do not set recovery_target_timeline=current for PostgreSQL < 12. - #2533

Merged
dwsteele merged 3 commits into
pgbackrest:integrationfrom
dwsteele:dev-tl-current
Jan 23, 2025
Merged

dwsteele merged 3 commits into
pgbackrest:integrationfrom
dwsteele:dev-tl-current

Conversation

@dwsteele

Copy link
Copy Markdown
Member

PostgreSQL < 12 defaults recovery_target_timeline to current but if current is explicitly set it behaves as if latest was set. Since current is not handled in the PostgreSQL code it looks as if there should be an error during the integer conversion but that doesn't happen due to incorrect strtoul() usage (not checking endptr).

Handle this by omitting recovery_target_timeline from recovery.conf when it is explicitly set by the user to current.

@dwsteele
dwsteele requested a review from pgstef January 22, 2025 20:33
@dwsteele dwsteele self-assigned this Jan 22, 2025
@dwsteele dwsteele added this to the 2.55 milestone Jan 22, 2025

@pgstef pgstef left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not set current when PostgreSQL < 12 since this is the default and if current is explicitly set it acts as latest

The comment explain it pretty good imo, so the change LGTM 👍

@dwsteele
dwsteele merged commit 6fbb28f into pgbackrest:integration Jan 23, 2025
@dwsteele
dwsteele deleted the dev-tl-current branch January 23, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants