Skip to content

Commit e32701b

Browse files
committed
initdb: Set collversion for standard collation UNICODE
Since the behavior of the UNICODE collation can change with new ICU/Unicode versions, we need to apply the versioning mechanism to it. We do this with an UPDATE command in initdb; this is similar to how we put the collation version into pg_database already. Reported-by: Daniel Verite <daniel@manitou-mail.org> Discussion: https://www.postgresql.org/message-id/49417853-7bdd-4b23-a4e9-04c7aff33821@manitou-mail.org
1 parent c8b881d commit e32701b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/bin/initdb/initdb.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,6 +1695,13 @@ setup_description(FILE *cmdfd)
16951695
static void
16961696
setup_collation(FILE *cmdfd)
16971697
{
1698+
/*
1699+
* Set the collation version for collations defined in pg_collation.dat,
1700+
* but not the ones where we know that the collation behavior will never
1701+
* change.
1702+
*/
1703+
PG_CMD_PUTS("UPDATE pg_collation SET collversion = pg_collation_actual_version(oid) WHERE collname = 'unicode';\n\n");
1704+
16981705
/* Import all collations we can find in the operating system */
16991706
PG_CMD_PUTS("SELECT pg_import_system_collations('pg_catalog');\n\n");
17001707
}

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
*/
5858

5959
/* yyyymmddN */
60-
#define CATALOG_VERSION_NO 202305041
60+
#define CATALOG_VERSION_NO 202305121
6161

6262
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy