Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca051d8

Browse files
committed
Add collation versions for FreeBSD.
On FreeBSD 13, use querylocale() to read the current version of libccollations. Similar to commits352f6f2 for Windows andd5ac14f forGNU/Linux.Discussion:https://postgr.es/m/CAEepm%3D0uEQCpfq_%2BLYFBdArCe4Ot98t1aR4eYiYTe%3DyavQygiQ%40mail.gmail.com
1 parenta4ef032 commitca051d8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

‎doc/src/sgml/charset.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,8 @@ CREATE COLLATION ignore_accents (provider = icu, locale = 'und-u-ks-level1-kc-tr
973973
Version information is available from the
974974
<literal>icu</literal> provider on all operating systems. For the
975975
<literal>libc</literal> provider, versions are currently only available
976-
on systems using the GNU C library (most Linux systems) and Windows.
976+
on systems using the GNU C library (most Linux systems), FreeBSD and
977+
Windows.
977978
</para>
978979

979980
<note>

‎src/backend/utils/adt/pg_locale.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,26 @@ get_collation_actual_version(char collprovider, const char *collcollate)
16841684

16851685
/* Use the glibc version because we don't have anything better. */
16861686
collversion=pstrdup(gnu_get_libc_version());
1687+
#elif defined(LC_VERSION_MASK)
1688+
locale_tloc;
1689+
1690+
/* C[.encoding] and POSIX never change. */
1691+
if (strcmp("C",collcollate)==0||
1692+
strncmp("C.",collcollate,2)==0||
1693+
strcmp("POSIX",collcollate)==0)
1694+
returnNULL;
1695+
1696+
/* Look up FreeBSD collation version. */
1697+
loc=newlocale(LC_COLLATE,collcollate,NULL);
1698+
if (loc)
1699+
{
1700+
collversion=
1701+
pstrdup(querylocale(LC_COLLATE_MASK |LC_VERSION_MASK,loc));
1702+
freelocale(loc);
1703+
}
1704+
else
1705+
ereport(ERROR,
1706+
(errmsg("could not load locale \"%s\"",collcollate)));
16871707
#elif defined(WIN32)&&_WIN32_WINNT >=0x0600
16881708
/*
16891709
* If we are targeting Windows Vista and above, we can ask for a name

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp