Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4389fc4

Browse files
author
Marina Polyakova
committed
ICU: fix pg_upgrade for Windows
In Postgres Pro version 9.6 and below, if: - the maximum length of the database encoding is greater that 1 - and the database locale for collations contains language or country strings (e.g. "Russian_Russia[.encoding]" or "English_United States[.encoding]") ICU used the root locale for the default collations. So invalidate indexes and check constraints that use the database default collation. P.S. Perhaps it would be safer to rename the database locale for collations in pg_database, but we could not find the same libc locale for the ICU root locale :(
1 parent 76fdf7a commit 4389fc4

File tree

5 files changed

+310
-74
lines changed

5 files changed

+310
-74
lines changed

src/bin/pg_upgrade/check.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ check_and_dump_old_cluster(bool live_check)
135135
if (old_cluster.edition != PG_ORIGINAL &&
136136
GET_MAJOR_VERSION(old_cluster.major_version) <= 906)
137137
{
138-
old_9_6_pgpro_invalidate_secondary_collation_indexes(&old_cluster, true);
139-
old_9_6_pgpro_invalidate_secondary_collation_constraints(&old_cluster, true);
138+
old_9_6_pgpro_invalidate_collation_indexes(&old_cluster, true);
139+
old_9_6_pgpro_invalidate_collation_constraints(&old_cluster, true);
140140
}
141141

142142
/*
@@ -209,8 +209,8 @@ issue_warnings_and_set_wal_level(void)
209209
if (old_cluster.edition != PG_ORIGINAL &&
210210
GET_MAJOR_VERSION(old_cluster.major_version) <= 906)
211211
{
212-
old_9_6_pgpro_invalidate_secondary_collation_indexes(&new_cluster, false);
213-
old_9_6_pgpro_invalidate_secondary_collation_constraints(&new_cluster, false);
212+
old_9_6_pgpro_invalidate_collation_indexes(&new_cluster, false);
213+
old_9_6_pgpro_invalidate_collation_constraints(&new_cluster, false);
214214
}
215215

216216
stop_postmaster(false);

src/bin/pg_upgrade/pg_upgrade.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,9 @@ void old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster);
450450
void old_9_6_check_for_unknown_data_type_usage(ClusterInfo *cluster);
451451
void old_9_6_invalidate_hash_indexes(ClusterInfo *cluster,
452452
bool check_mode);
453-
void old_9_6_pgpro_invalidate_secondary_collation_indexes(ClusterInfo *cluster,
453+
void old_9_6_pgpro_invalidate_collation_indexes(ClusterInfo *cluster,
454454
bool check_mode);
455-
void old_9_6_pgpro_invalidate_secondary_collation_constraints(ClusterInfo *cluster, bool check_mode);
455+
void old_9_6_pgpro_invalidate_collation_constraints(ClusterInfo *cluster, bool check_mode);
456456

457457
/* parallel.c */
458458
void parallel_exec_prog(const char *log_file, const char *opt_log_file,

0 commit comments

Comments
 (0)