Commit 8556267b authored by Thomas Munro's avatar Thomas Munro

Revert "pg_collation_actual_version() -> pg_collation_current_version()."

This reverts commit 9cf184cc.  Name
change less well received than anticipated.

Discussion: https://postgr.es/m/afcfb97e-88a1-a540-db95-6c573b93bc2b%40eisentraut.org
parent 80ca8464
...@@ -26238,14 +26238,14 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); ...@@ -26238,14 +26238,14 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
<row> <row>
<entry role="func_table_entry"><para role="func_signature"> <entry role="func_table_entry"><para role="func_signature">
<indexterm> <indexterm>
<primary>pg_collation_current_version</primary> <primary>pg_collation_actual_version</primary>
</indexterm> </indexterm>
<function>pg_collation_current_version</function> ( <type>oid</type> ) <function>pg_collation_actual_version</function> ( <type>oid</type> )
<returnvalue>text</returnvalue> <returnvalue>text</returnvalue>
</para> </para>
<para> <para>
Returns the version of the collation object as reported by the ICU Returns the actual version of the collation object as it is currently
library or operating system. <literal>null</literal> is returned installed in the operating system. <literal>null</literal> is returned
on operating systems where <productname>PostgreSQL</productname> on operating systems where <productname>PostgreSQL</productname>
doesn't have support for versions. doesn't have support for versions.
</para></entry> </para></entry>
......
...@@ -268,7 +268,7 @@ IsThereCollationInNamespace(const char *collname, Oid nspOid) ...@@ -268,7 +268,7 @@ IsThereCollationInNamespace(const char *collname, Oid nspOid)
} }
Datum Datum
pg_collation_current_version(PG_FUNCTION_ARGS) pg_collation_actual_version(PG_FUNCTION_ARGS)
{ {
Oid collid = PG_GETARG_OID(0); Oid collid = PG_GETARG_OID(0);
char *version; char *version;
......
...@@ -127,8 +127,8 @@ static char *IsoLocaleName(const char *); /* MSVC specific */ ...@@ -127,8 +127,8 @@ static char *IsoLocaleName(const char *); /* MSVC specific */
static void icu_set_collation_attributes(UCollator *collator, const char *loc); static void icu_set_collation_attributes(UCollator *collator, const char *loc);
#endif #endif
static char *get_collation_current_version(char collprovider, static char *get_collation_actual_version(char collprovider,
const char *collcollate); const char *collcollate);
/* /*
* pg_perm_setlocale * pg_perm_setlocale
...@@ -1610,7 +1610,7 @@ pg_newlocale_from_collation(Oid collid) ...@@ -1610,7 +1610,7 @@ pg_newlocale_from_collation(Oid collid)
* the operating system/library. * the operating system/library.
*/ */
static char * static char *
get_collation_current_version(char collprovider, const char *collcollate) get_collation_actual_version(char collprovider, const char *collcollate)
{ {
char *collversion = NULL; char *collversion = NULL;
...@@ -1717,8 +1717,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok) ...@@ -1717,8 +1717,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok)
if (!HeapTupleIsValid(tp)) if (!HeapTupleIsValid(tp))
elog(ERROR, "cache lookup failed for database %u", MyDatabaseId); elog(ERROR, "cache lookup failed for database %u", MyDatabaseId);
dbform = (Form_pg_database) GETSTRUCT(tp); dbform = (Form_pg_database) GETSTRUCT(tp);
version = get_collation_current_version(COLLPROVIDER_LIBC, version = get_collation_actual_version(COLLPROVIDER_LIBC,
NameStr(dbform->datcollate)); NameStr(dbform->datcollate));
} }
else else
{ {
...@@ -1732,8 +1732,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok) ...@@ -1732,8 +1732,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok)
elog(ERROR, "cache lookup failed for collation %u", oid); elog(ERROR, "cache lookup failed for collation %u", oid);
} }
collform = (Form_pg_collation) GETSTRUCT(tp); collform = (Form_pg_collation) GETSTRUCT(tp);
version = get_collation_current_version(collform->collprovider, version = get_collation_actual_version(collform->collprovider,
NameStr(collform->collcollate)); NameStr(collform->collcollate));
} }
ReleaseSysCache(tp); ReleaseSysCache(tp);
......
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 202102221 #define CATALOG_VERSION_NO 202102191
#endif #endif
...@@ -11321,9 +11321,9 @@ ...@@ -11321,9 +11321,9 @@
{ oid => '3448', { oid => '3448',
descr => 'get actual version of collation from operating system', descr => 'get actual version of collation from operating system',
proname => 'pg_collation_current_version', procost => '100', proname => 'pg_collation_actual_version', procost => '100',
provolatile => 'v', prorettype => 'text', proargtypes => 'oid', provolatile => 'v', prorettype => 'text', proargtypes => 'oid',
prosrc => 'pg_collation_current_version' }, prosrc => 'pg_collation_actual_version' },
# system management/monitoring related functions # system management/monitoring related functions
{ oid => '3353', descr => 'list files in the log directory', { oid => '3353', descr => 'list files in the log directory',
......
...@@ -2018,7 +2018,7 @@ SELECT objid::regclass::text collate "C", refobjid::regcollation::text collate " ...@@ -2018,7 +2018,7 @@ SELECT objid::regclass::text collate "C", refobjid::regcollation::text collate "
CASE CASE
WHEN refobjid = 'default'::regcollation THEN 'XXX' -- depends on libc version support WHEN refobjid = 'default'::regcollation THEN 'XXX' -- depends on libc version support
WHEN refobjversion IS NULL THEN 'version not tracked' WHEN refobjversion IS NULL THEN 'version not tracked'
WHEN refobjversion = pg_collation_current_version(refobjid) THEN 'up to date' WHEN refobjversion = pg_collation_actual_version(refobjid) THEN 'up to date'
ELSE 'out of date' ELSE 'out of date'
END AS version END AS version
FROM pg_depend d FROM pg_depend d
...@@ -2156,14 +2156,14 @@ RESET client_min_messages; ...@@ -2156,14 +2156,14 @@ RESET client_min_messages;
-- leave a collation for pg_upgrade test -- leave a collation for pg_upgrade test
CREATE COLLATION coll_icu_upgrade FROM "und-x-icu"; CREATE COLLATION coll_icu_upgrade FROM "und-x-icu";
-- Test user-visible function for inspecting versions -- Test user-visible function for inspecting versions
SELECT pg_collation_current_version('"en-x-icu"'::regcollation) is not null; SELECT pg_collation_actual_version('"en-x-icu"'::regcollation) is not null;
?column? ?column?
---------- ----------
t t
(1 row) (1 row)
-- Invalid OIDs are silently ignored -- Invalid OIDs are silently ignored
SELECT pg_collation_current_version(0) is null; SELECT pg_collation_actual_version(0) is null;
?column? ?column?
---------- ----------
t t
......
...@@ -820,7 +820,7 @@ SELECT objid::regclass::text collate "C", refobjid::regcollation::text collate " ...@@ -820,7 +820,7 @@ SELECT objid::regclass::text collate "C", refobjid::regcollation::text collate "
CASE CASE
WHEN refobjid = 'default'::regcollation THEN 'XXX' -- depends on libc version support WHEN refobjid = 'default'::regcollation THEN 'XXX' -- depends on libc version support
WHEN refobjversion IS NULL THEN 'version not tracked' WHEN refobjversion IS NULL THEN 'version not tracked'
WHEN refobjversion = pg_collation_current_version(refobjid) THEN 'up to date' WHEN refobjversion = pg_collation_actual_version(refobjid) THEN 'up to date'
ELSE 'out of date' ELSE 'out of date'
END AS version END AS version
FROM pg_depend d FROM pg_depend d
...@@ -885,6 +885,6 @@ RESET client_min_messages; ...@@ -885,6 +885,6 @@ RESET client_min_messages;
CREATE COLLATION coll_icu_upgrade FROM "und-x-icu"; CREATE COLLATION coll_icu_upgrade FROM "und-x-icu";
-- Test user-visible function for inspecting versions -- Test user-visible function for inspecting versions
SELECT pg_collation_current_version('"en-x-icu"'::regcollation) is not null; SELECT pg_collation_actual_version('"en-x-icu"'::regcollation) is not null;
-- Invalid OIDs are silently ignored -- Invalid OIDs are silently ignored
SELECT pg_collation_current_version(0) is null; SELECT pg_collation_actual_version(0) is null;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment