summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2023-05-12 09:45:50 +0200
committerPeter Eisentraut <peter@eisentraut.org>2023-05-12 10:03:05 +0200
commite32701b8d285cd402f75fc9059d083e89ee8166b (patch)
tree35dad8be0adc4ddbec55e9f7637beaf7994f8d81
parentc8b881d21fd8e0214bc43280d6231cc2c6ef55ef (diff)
downloadpostgresql-e32701b8d285cd402f75fc9059d083e89ee8166b.tar.gz
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
-rw-r--r--src/bin/initdb/initdb.c7
-rw-r--r--src/include/catalog/catversion.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 2c208ead01..e03d498b1e 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -1695,6 +1695,13 @@ setup_description(FILE *cmdfd)
static void
setup_collation(FILE *cmdfd)
{
+ /*
+ * Set the collation version for collations defined in pg_collation.dat,
+ * but not the ones where we know that the collation behavior will never
+ * change.
+ */
+ PG_CMD_PUTS("UPDATE pg_collation SET collversion = pg_collation_actual_version(oid) WHERE collname = 'unicode';\n\n");
+
/* Import all collations we can find in the operating system */
PG_CMD_PUTS("SELECT pg_import_system_collations('pg_catalog');\n\n");
}
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index a091f2ca26..d10cc28b0c 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -57,6 +57,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202305041
+#define CATALOG_VERSION_NO 202305121
#endif