1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00
Heikki Linnakangas 5f003855e7 Fix pg_strupper/lower/title/fold() functions to work with C locale
Starting with commit 011384ba45, calling to_date() or to_timestamp()
with "TMMonth" or other TM-prefixed format keyword, with the C locale,
would crash.

In REL_19_STABLE and above, pg_strupper(), pg_strlower(),
pg_strtitle(), and pg_strfold() functions have a special case for the
C locale, but that was missing in REL_18_STABLE.  On REL_18_STABLE,
the functions call the libc function even in C locale, even though the
native locale object is NULL.  On Linux, the underlying libc functions
will crash when called with NULL locale.  (On macOS, they reportedly
do not, but even then it's not clear if they will do what you'd
expect.)

This went unnoticed because until commit 011384ba45, we never called
these functions in C locale, all the callers had a special codepath
for C locale.  We could add a special path in the new callers too, but
it's an accident waiting to happen, so let's backport the C
locale-specific handling from REL_19_STABLE to REL_18_STABLE.  Older
versions did not have these functions at all, hence no problem.

This applies to REL_18_STABLE only.

Reported-by: Masashi Kamura <kamura.masashi@fujitsu.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://www.postgresql.org/message-id/OS9PR01MB1317436E07D06281AD1A0452F94DD2%40OS9PR01MB13174.jpnprd01.prod.outlook.com
2026-08-11 21:24:28 +03:00
2025-08-14 12:09:53 -04:00
2025-08-15 10:32:22 +02:00
2022-12-04 15:23:00 -05:00
2024-11-05 13:56:02 +01:00
2026-08-10 16:52:29 -04:00
2026-08-10 16:52:29 -04:00
2026-01-01 13:24:10 -05:00
2020-02-10 20:47:50 +01:00
2026-08-10 16:52:29 -04:00

PostgreSQL Database Management System

This directory contains the source code distribution of the PostgreSQL database management system.

PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.

Copyright and license information can be found in the file COPYRIGHT.

General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/18/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/18/installation.html.

The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.

Description
Зеркало официального репозитория PostgreSQL GIT
Readme 1.3 GiB
Languages
C 83.9%
PLpgSQL 6.2%
Perl 5.4%
Yacc 1.2%
Meson 0.7%
Other 2.4%