Auto-detect locale from old cluster during upgrade#51
Open
fila43 wants to merge 1 commit intodevexp-db:masterfrom
Open
Auto-detect locale from old cluster during upgrade#51fila43 wants to merge 1 commit intodevexp-db:masterfrom
fila43 wants to merge 1 commit intodevexp-db:masterfrom
Conversation
Automatically detect and preserve locale settings (lc_collate, lc_ctype) from the old PostgreSQL cluster during upgrade operations. This fixes upgrade failures when system locale has changed between initialization and upgrade. The implementation queries locale from the old cluster's template1 database, temporarily starting the server if needed. Detected locale values are automatically passed to initdb via PGSETUP_INITDB_OPTIONS. Fixes: Bug 1152556
pkhartsk
suggested changes
Feb 3, 2026
pkhartsk
left a comment
There was a problem hiding this comment.
Everything else seems fine, I'll write some tests.
Comment on lines
+288
to
+291
| result=$("$old_bindir/psql" -t -A -h "$temp_sockdir" -p "$query_port" -d template1 -c "$query" 2>/dev/null) | ||
| psql_exit_code=$? | ||
| else | ||
| result=$("$old_bindir/psql" -t -A -p "$query_port" -d template1 -c "$query" 2>/dev/null) |
There was a problem hiding this comment.
should be just psql without the $old_bindir since it's not actually shipped there and the client works with old server versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatically detect and preserve locale settings (lc_collate, lc_ctype) from the old PostgreSQL cluster during upgrade operations. This fixes upgrade failures when system locale has changed between initialization and upgrade.
The implementation queries locale from the old cluster's template1 database, temporarily starting the server if needed. Detected locale values are automatically passed to initdb via PGSETUP_INITDB_OPTIONS.
Fixes: Bug 1152556
It Needs to be tested