Skip to content

Commit 8556267

Browse files
committed
Revert "pg_collation_actual_version() -> pg_collation_current_version()."
This reverts commit 9cf184c. Name change less well received than anticipated. Discussion: https://postgr.es/m/afcfb97e-88a1-a540-db95-6c573b93bc2b%40eisentraut.org
1 parent 80ca846 commit 8556267

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

doc/src/sgml/func.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26238,14 +26238,14 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
2623826238
<row>
2623926239
<entry role="func_table_entry"><para role="func_signature">
2624026240
<indexterm>
26241-
<primary>pg_collation_current_version</primary>
26241+
<primary>pg_collation_actual_version</primary>
2624226242
</indexterm>
26243-
<function>pg_collation_current_version</function> ( <type>oid</type> )
26243+
<function>pg_collation_actual_version</function> ( <type>oid</type> )
2624426244
<returnvalue>text</returnvalue>
2624526245
</para>
2624626246
<para>
26247-
Returns the version of the collation object as reported by the ICU
26248-
library or operating system. <literal>null</literal> is returned
26247+
Returns the actual version of the collation object as it is currently
26248+
installed in the operating system. <literal>null</literal> is returned
2624926249
on operating systems where <productname>PostgreSQL</productname>
2625026250
doesn't have support for versions.
2625126251
</para></entry>

src/backend/commands/collationcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ IsThereCollationInNamespace(const char *collname, Oid nspOid)
268268
}
269269

270270
Datum
271-
pg_collation_current_version(PG_FUNCTION_ARGS)
271+
pg_collation_actual_version(PG_FUNCTION_ARGS)
272272
{
273273
Oid collid = PG_GETARG_OID(0);
274274
char *version;

src/backend/utils/adt/pg_locale.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ static char *IsoLocaleName(const char *); /* MSVC specific */
127127
static void icu_set_collation_attributes(UCollator *collator, const char *loc);
128128
#endif
129129

130-
static char *get_collation_current_version(char collprovider,
131-
const char *collcollate);
130+
static char *get_collation_actual_version(char collprovider,
131+
const char *collcollate);
132132

133133
/*
134134
* pg_perm_setlocale
@@ -1610,7 +1610,7 @@ pg_newlocale_from_collation(Oid collid)
16101610
* the operating system/library.
16111611
*/
16121612
static char *
1613-
get_collation_current_version(char collprovider, const char *collcollate)
1613+
get_collation_actual_version(char collprovider, const char *collcollate)
16141614
{
16151615
char *collversion = NULL;
16161616

@@ -1717,8 +1717,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok)
17171717
if (!HeapTupleIsValid(tp))
17181718
elog(ERROR, "cache lookup failed for database %u", MyDatabaseId);
17191719
dbform = (Form_pg_database) GETSTRUCT(tp);
1720-
version = get_collation_current_version(COLLPROVIDER_LIBC,
1721-
NameStr(dbform->datcollate));
1720+
version = get_collation_actual_version(COLLPROVIDER_LIBC,
1721+
NameStr(dbform->datcollate));
17221722
}
17231723
else
17241724
{
@@ -1732,8 +1732,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok)
17321732
elog(ERROR, "cache lookup failed for collation %u", oid);
17331733
}
17341734
collform = (Form_pg_collation) GETSTRUCT(tp);
1735-
version = get_collation_current_version(collform->collprovider,
1736-
NameStr(collform->collcollate));
1735+
version = get_collation_actual_version(collform->collprovider,
1736+
NameStr(collform->collcollate));
17371737
}
17381738

17391739
ReleaseSysCache(tp);

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 202102221
56+
#define CATALOG_VERSION_NO 202102191
5757

5858
#endif

src/include/catalog/pg_proc.dat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11321,9 +11321,9 @@
1132111321

1132211322
{ oid => '3448',
1132311323
descr => 'get actual version of collation from operating system',
11324-
proname => 'pg_collation_current_version', procost => '100',
11324+
proname => 'pg_collation_actual_version', procost => '100',
1132511325
provolatile => 'v', prorettype => 'text', proargtypes => 'oid',
11326-
prosrc => 'pg_collation_current_version' },
11326+
prosrc => 'pg_collation_actual_version' },
1132711327

1132811328
# system management/monitoring related functions
1132911329
{ oid => '3353', descr => 'list files in the log directory',

src/test/regress/expected/collate.icu.utf8.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,7 +2018,7 @@ SELECT objid::regclass::text collate "C", refobjid::regcollation::text collate "
20182018
CASE
20192019
WHEN refobjid = 'default'::regcollation THEN 'XXX' -- depends on libc version support
20202020
WHEN refobjversion IS NULL THEN 'version not tracked'
2021-
WHEN refobjversion = pg_collation_current_version(refobjid) THEN 'up to date'
2021+
WHEN refobjversion = pg_collation_actual_version(refobjid) THEN 'up to date'
20222022
ELSE 'out of date'
20232023
END AS version
20242024
FROM pg_depend d
@@ -2156,14 +2156,14 @@ RESET client_min_messages;
21562156
-- leave a collation for pg_upgrade test
21572157
CREATE COLLATION coll_icu_upgrade FROM "und-x-icu";
21582158
-- Test user-visible function for inspecting versions
2159-
SELECT pg_collation_current_version('"en-x-icu"'::regcollation) is not null;
2159+
SELECT pg_collation_actual_version('"en-x-icu"'::regcollation) is not null;
21602160
?column?
21612161
----------
21622162
t
21632163
(1 row)
21642164

21652165
-- Invalid OIDs are silently ignored
2166-
SELECT pg_collation_current_version(0) is null;
2166+
SELECT pg_collation_actual_version(0) is null;
21672167
?column?
21682168
----------
21692169
t

src/test/regress/sql/collate.icu.utf8.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ SELECT objid::regclass::text collate "C", refobjid::regcollation::text collate "
820820
CASE
821821
WHEN refobjid = 'default'::regcollation THEN 'XXX' -- depends on libc version support
822822
WHEN refobjversion IS NULL THEN 'version not tracked'
823-
WHEN refobjversion = pg_collation_current_version(refobjid) THEN 'up to date'
823+
WHEN refobjversion = pg_collation_actual_version(refobjid) THEN 'up to date'
824824
ELSE 'out of date'
825825
END AS version
826826
FROM pg_depend d
@@ -885,6 +885,6 @@ RESET client_min_messages;
885885
CREATE COLLATION coll_icu_upgrade FROM "und-x-icu";
886886

887887
-- Test user-visible function for inspecting versions
888-
SELECT pg_collation_current_version('"en-x-icu"'::regcollation) is not null;
888+
SELECT pg_collation_actual_version('"en-x-icu"'::regcollation) is not null;
889889
-- Invalid OIDs are silently ignored
890-
SELECT pg_collation_current_version(0) is null;
890+
SELECT pg_collation_actual_version(0) is null;

0 commit comments

Comments
 (0)