Skip to content

Commit 9cf184c

Browse files
committed
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
1 parent 0fb0a05 commit 9cf184c

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
@@ -26227,14 +26227,14 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
2622726227
<row>
2622826228
<entry role="func_table_entry"><para role="func_signature">
2622926229
<indexterm>
26230-
<primary>pg_collation_actual_version</primary>
26230+
<primary>pg_collation_current_version</primary>
2623126231
</indexterm>
26232-
<function>pg_collation_actual_version</function> ( <type>oid</type> )
26232+
<function>pg_collation_current_version</function> ( <type>oid</type> )
2623326233
<returnvalue>text</returnvalue>
2623426234
</para>
2623526235
<para>
26236-
Returns the actual version of the collation object as it is currently
26237-
installed in the operating system. <literal>null</literal> is returned
26236+
Returns the version of the collation object as reported by the ICU
26237+
library or operating system. <literal>null</literal> is returned
2623826238
on operating systems where <productname>PostgreSQL</productname>
2623926239
doesn't have support for versions.
2624026240
</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_actual_version(PG_FUNCTION_ARGS)
271+
pg_collation_current_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_actual_version(char collprovider,
131-
const char *collcollate);
130+
static char *get_collation_current_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_actual_version(char collprovider, const char *collcollate)
1613+
get_collation_current_version(char collprovider, const char *collcollate)
16141614
{
16151615
char *collversion = NULL;
16161616

@@ -1743,8 +1743,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok)
17431743
if (!HeapTupleIsValid(tp))
17441744
elog(ERROR, "cache lookup failed for database %u", MyDatabaseId);
17451745
dbform = (Form_pg_database) GETSTRUCT(tp);
1746-
version = get_collation_actual_version(COLLPROVIDER_LIBC,
1747-
NameStr(dbform->datcollate));
1746+
version = get_collation_current_version(COLLPROVIDER_LIBC,
1747+
NameStr(dbform->datcollate));
17481748
}
17491749
else
17501750
{
@@ -1758,8 +1758,8 @@ get_collation_version_for_oid(Oid oid, bool missing_ok)
17581758
elog(ERROR, "cache lookup failed for collation %u", oid);
17591759
}
17601760
collform = (Form_pg_collation) GETSTRUCT(tp);
1761-
version = get_collation_actual_version(collform->collprovider,
1762-
NameStr(collform->collcollate));
1761+
version = get_collation_current_version(collform->collprovider,
1762+
NameStr(collform->collcollate));
17631763
}
17641764

17651765
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 202102191
56+
#define CATALOG_VERSION_NO 202102221
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_actual_version', procost => '100',
11324+
proname => 'pg_collation_current_version', procost => '100',
1132511325
provolatile => 'v', prorettype => 'text', proargtypes => 'oid',
11326-
prosrc => 'pg_collation_actual_version' },
11326+
prosrc => 'pg_collation_current_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_actual_version(refobjid) THEN 'up to date'
2021+
WHEN refobjversion = pg_collation_current_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_actual_version('"en-x-icu"'::regcollation) is not null;
2159+
SELECT pg_collation_current_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_actual_version(0) is null;
2166+
SELECT pg_collation_current_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_actual_version(refobjid) THEN 'up to date'
823+
WHEN refobjversion = pg_collation_current_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_actual_version('"en-x-icu"'::regcollation) is not null;
888+
SELECT pg_collation_current_version('"en-x-icu"'::regcollation) is not null;
889889
-- Invalid OIDs are silently ignored
890-
SELECT pg_collation_actual_version(0) is null;
890+
SELECT pg_collation_current_version(0) is null;

0 commit comments

Comments
 (0)