git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 80ca846)
Revert "pg_collation_actual_version() -> pg_collation_current_version()."
2021年2月26日 02:29:27 +0000 (15:29 +1300)
2021年2月26日 02:29:27 +0000 (15:29 +1300)
This reverts commit 9cf184cc0599b6e65e7e5ecd9d91cd42e278bcd8. Name
change less well received than anticipated.

Discussion: https://postgr.es/m/afcfb97e-88a1-a540-db95-6c573b93bc2b%40eisentraut.org


diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index c5048a199886ca8b6de3b58d1dfa061c38730e6b..08f08322ca51b46c64f1911ec54b854b2b1cdab0 100644 (file)
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -26238,14 +26238,14 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>pg_collation_current_version</primary>
+ <primary>pg_collation_actual_version</primary>
</indexterm>
- <function>pg_collation_current_version</function> ( <type>oid</type> )
+ <function>pg_collation_actual_version</function> ( <type>oid</type> )
<returnvalue>text</returnvalue>
</para>
<para>
- Returns the version of the collation object as reported by the ICU
- library or operating system. <literal>null</literal> is returned
+ Returns the actual version of the collation object as it is currently
+ installed in the operating system. <literal>null</literal> is returned
on operating systems where <productname>PostgreSQL</productname>
doesn't have support for versions.
</para></entry>
diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c
index 4b76a6051d23498a62aa5213f31fa80f91b65534..a7ee452e192eb9968181e89fde12eda21f260d6c 100644 (file)
--- 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_current_version(PG_FUNCTION_ARGS)
+pg_collation_actual_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 df1f36132d38a8f6115b5782345bb75112ff5fa8..aa4874163f88e6c2add6a9655a5ca13f9cba7fd4 100644 (file)
--- 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_current_version(char collprovider,
- const char *collcollate);
+static char *get_collation_actual_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_current_version(char collprovider, const char *collcollate)
+get_collation_actual_version(char collprovider, const char *collcollate)
{
char *collversion = NULL;
@@ -1717,8 +1717,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_current_version(COLLPROVIDER_LIBC,
- NameStr(dbform->datcollate));
+ version = get_collation_actual_version(COLLPROVIDER_LIBC,
+ NameStr(dbform->datcollate));
}
else
{
@@ -1732,8 +1732,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_current_version(collform->collprovider,
- NameStr(collform->collcollate));
+ version = get_collation_actual_version(collform->collprovider,
+ NameStr(collform->collcollate));
}
ReleaseSysCache(tp);
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index e94f97437045ac56d29d385b42b3f62463c4ecb9..4cc94de224a8530370f23d6a4176977a62e20c3a 100644 (file)
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202102221
+#define CATALOG_VERSION_NO 202102191
#endif
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 16044125ba465b3a7bacb8a2ba2b5ae2c7ad86ca..1487710d590773c8a64170c24f78c1370f0de834 100644 (file)
--- 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_current_version', procost => '100',
+ proname => 'pg_collation_actual_version', procost => '100',
provolatile => 'v', prorettype => 'text', proargtypes => 'oid',
- prosrc => 'pg_collation_current_version' },
+ prosrc => 'pg_collation_actual_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 43fbff1de20178179e4677a1c28d29979761389b..de70cb121274d6a1a9c63f13512c01580c1a8713 100644 (file)
--- 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_current_version(refobjid) THEN 'up to date'
+WHEN refobjversion = pg_collation_actual_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_current_version('"en-x-icu"'::regcollation) is not null;
+SELECT pg_collation_actual_version('"en-x-icu"'::regcollation) is not null;
?column?
----------
t
(1 row)
-- Invalid OIDs are silently ignored
-SELECT pg_collation_current_version(0) is null;
+SELECT pg_collation_actual_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 8b341dbb2429a353ba12f2ec49975bded44c4312..dd5d208854747bef463fd4db5641832671671da6 100644 (file)
--- 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_current_version(refobjid) THEN 'up to date'
+WHEN refobjversion = pg_collation_actual_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_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
-SELECT pg_collation_current_version(0) is null;
+SELECT pg_collation_actual_version(0) is null;
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /