mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
pg_collation_actual_version() -> pg_collation_current_version().
The new name seems a bit more natural. Discussion: https://postgr.es/m/20210117215940.GE8560%40telsasoft.com
This commit is contained in:
parent
0fb0a0503b
commit
9cf184cc05
@ -26227,14 +26227,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_actual_version</primary>
|
<primary>pg_collation_current_version</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
<function>pg_collation_actual_version</function> ( <type>oid</type> )
|
<function>pg_collation_current_version</function> ( <type>oid</type> )
|
||||||
<returnvalue>text</returnvalue>
|
<returnvalue>text</returnvalue>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Returns the actual version of the collation object as it is currently
|
Returns the version of the collation object as reported by the ICU
|
||||||
installed in the operating system. <literal>null</literal> is returned
|
library or 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)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Datum
|
Datum
|
||||||
pg_collation_actual_version(PG_FUNCTION_ARGS)
|
pg_collation_current_version(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
Oid collid = PG_GETARG_OID(0);
|
Oid collid = PG_GETARG_OID(0);
|
||||||
char *version;
|
char *version;
|
||||||
|
@ -127,7 +127,7 @@ 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_actual_version(char collprovider,
|
static char *get_collation_current_version(char collprovider,
|
||||||
const char *collcollate);
|
const char *collcollate);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1610,7 +1610,7 @@ pg_newlocale_from_collation(Oid collid)
|
|||||||
* the operating system/library.
|
* the operating system/library.
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
get_collation_actual_version(char collprovider, const char *collcollate)
|
get_collation_current_version(char collprovider, const char *collcollate)
|
||||||
{
|
{
|
||||||
char *collversion = NULL;
|
char *collversion = NULL;
|
||||||
|
|
||||||
@ -1743,7 +1743,7 @@ 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_actual_version(COLLPROVIDER_LIBC,
|
version = get_collation_current_version(COLLPROVIDER_LIBC,
|
||||||
NameStr(dbform->datcollate));
|
NameStr(dbform->datcollate));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1758,7 +1758,7 @@ 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_actual_version(collform->collprovider,
|
version = get_collation_current_version(collform->collprovider,
|
||||||
NameStr(collform->collcollate));
|
NameStr(collform->collcollate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 202102191
|
#define CATALOG_VERSION_NO 202102221
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -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_actual_version', procost => '100',
|
proname => 'pg_collation_current_version', procost => '100',
|
||||||
provolatile => 'v', prorettype => 'text', proargtypes => 'oid',
|
provolatile => 'v', prorettype => 'text', proargtypes => 'oid',
|
||||||
prosrc => 'pg_collation_actual_version' },
|
prosrc => 'pg_collation_current_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 "
|
|||||||
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_actual_version(refobjid) THEN 'up to date'
|
WHEN refobjversion = pg_collation_current_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;
|
|||||||
-- 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_actual_version('"en-x-icu"'::regcollation) is not null;
|
SELECT pg_collation_current_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_actual_version(0) is null;
|
SELECT pg_collation_current_version(0) is null;
|
||||||
?column?
|
?column?
|
||||||
----------
|
----------
|
||||||
t
|
t
|
||||||
|
@ -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_actual_version(refobjid) THEN 'up to date'
|
WHEN refobjversion = pg_collation_current_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;
|
|||||||
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_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
|
-- Invalid OIDs are silently ignored
|
||||||
SELECT pg_collation_actual_version(0) is null;
|
SELECT pg_collation_current_version(0) is null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user