diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 1ab31a90561..d8224272a57 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -26227,14 +26227,14 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); - pg_collation_actual_version + pg_collation_current_version - pg_collation_actual_version ( oid ) + pg_collation_current_version ( oid ) text - Returns the actual version of the collation object as it is currently - installed in the operating system. null is returned + Returns the version of the collation object as reported by the ICU + library or operating system. null is returned on operating systems where PostgreSQL doesn't have support for versions. diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c index a7ee452e192..4b76a6051d2 100644 --- a/src/backend/commands/collationcmds.c +++ b/src/backend/commands/collationcmds.c @@ -268,7 +268,7 @@ IsThereCollationInNamespace(const char *collname, Oid nspOid) } Datum -pg_collation_actual_version(PG_FUNCTION_ARGS) +pg_collation_current_version(PG_FUNCTION_ARGS) { Oid collid = PG_GETARG_OID(0); char *version; diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index 34b82b9335c..2e4c6e9a263 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -127,8 +127,8 @@ static char *IsoLocaleName(const char *); /* MSVC specific */ static void icu_set_collation_attributes(UCollator *collator, const char *loc); #endif -static char *get_collation_actual_version(char collprovider, - const char *collcollate); +static char *get_collation_current_version(char collprovider, + const char *collcollate); /* * pg_perm_setlocale @@ -1610,7 +1610,7 @@ pg_newlocale_from_collation(Oid collid) * the operating system/library. */ static char * -get_collation_actual_version(char collprovider, const char *collcollate) +get_collation_current_version(char collprovider, const char *collcollate) { char *collversion = NULL; @@ -1743,8 +1743,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok) if (!HeapTupleIsValid(tp)) elog(ERROR, "cache lookup failed for database %u", MyDatabaseId); dbform = (Form_pg_database) GETSTRUCT(tp); - version = get_collation_actual_version(COLLPROVIDER_LIBC, - NameStr(dbform->datcollate)); + version = get_collation_current_version(COLLPROVIDER_LIBC, + NameStr(dbform->datcollate)); } else { @@ -1758,8 +1758,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok) elog(ERROR, "cache lookup failed for collation %u", oid); } collform = (Form_pg_collation) GETSTRUCT(tp); - version = get_collation_actual_version(collform->collprovider, - NameStr(collform->collcollate)); + version = get_collation_current_version(collform->collprovider, + NameStr(collform->collcollate)); } ReleaseSysCache(tp); diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 4cc94de224a..e94f9743704 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202102191 +#define CATALOG_VERSION_NO 202102221 #endif diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 1487710d590..16044125ba4 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -11321,9 +11321,9 @@ { oid => '3448', descr => 'get actual version of collation from operating system', - proname => 'pg_collation_actual_version', procost => '100', + proname => 'pg_collation_current_version', procost => '100', provolatile => 'v', prorettype => 'text', proargtypes => 'oid', - prosrc => 'pg_collation_actual_version' }, + prosrc => 'pg_collation_current_version' }, # system management/monitoring related functions { oid => '3353', descr => 'list files in the log directory', diff --git a/src/test/regress/expected/collate.icu.utf8.out b/src/test/regress/expected/collate.icu.utf8.out index de70cb12127..43fbff1de20 100644 --- a/src/test/regress/expected/collate.icu.utf8.out +++ b/src/test/regress/expected/collate.icu.utf8.out @@ -2018,7 +2018,7 @@ SELECT objid::regclass::text collate "C", refobjid::regcollation::text collate " CASE WHEN refobjid = 'default'::regcollation THEN 'XXX' -- depends on libc version support WHEN refobjversion IS NULL THEN 'version not tracked' -WHEN refobjversion = pg_collation_actual_version(refobjid) THEN 'up to date' +WHEN refobjversion = pg_collation_current_version(refobjid) THEN 'up to date' ELSE 'out of date' END AS version FROM pg_depend d @@ -2156,14 +2156,14 @@ RESET client_min_messages; -- leave a collation for pg_upgrade test CREATE COLLATION coll_icu_upgrade FROM "und-x-icu"; -- Test user-visible function for inspecting versions -SELECT pg_collation_actual_version('"en-x-icu"'::regcollation) is not null; +SELECT pg_collation_current_version('"en-x-icu"'::regcollation) is not null; ?column? ---------- t (1 row) -- Invalid OIDs are silently ignored -SELECT pg_collation_actual_version(0) is null; +SELECT pg_collation_current_version(0) is null; ?column? ---------- t diff --git a/src/test/regress/sql/collate.icu.utf8.sql b/src/test/regress/sql/collate.icu.utf8.sql index dd5d2088547..8b341dbb242 100644 --- a/src/test/regress/sql/collate.icu.utf8.sql +++ b/src/test/regress/sql/collate.icu.utf8.sql @@ -820,7 +820,7 @@ SELECT objid::regclass::text collate "C", refobjid::regcollation::text collate " CASE WHEN refobjid = 'default'::regcollation THEN 'XXX' -- depends on libc version support WHEN refobjversion IS NULL THEN 'version not tracked' -WHEN refobjversion = pg_collation_actual_version(refobjid) THEN 'up to date' +WHEN refobjversion = pg_collation_current_version(refobjid) THEN 'up to date' ELSE 'out of date' END AS version FROM pg_depend d @@ -885,6 +885,6 @@ RESET client_min_messages; CREATE COLLATION coll_icu_upgrade FROM "und-x-icu"; -- Test user-visible function for inspecting versions -SELECT pg_collation_actual_version('"en-x-icu"'::regcollation) is not null; +SELECT pg_collation_current_version('"en-x-icu"'::regcollation) is not null; -- Invalid OIDs are silently ignored -SELECT pg_collation_actual_version(0) is null; +SELECT pg_collation_current_version(0) is null;