From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Call pg_newlocale_from_collation() also with default collation
Date: Thu, 20 Jan 2022 09:01:52 +0000
Message-ID: <E1nATKK-0002dv-L1@gemulon.postgresql.org> (raw)
Call pg_newlocale_from_collation() also with default collation
Previously, callers of pg_newlocale_from_collation() did not call it
if the collation was DEFAULT_COLLATION_OID and instead proceeded with
a pg_locale_t of 0. Instead, now we call it anyway and have it return
0 if the default collation was passed. It already did this, so we
just have to adjust the callers. This simplifies all the call sites
and also makes future enhancements easier.
After discussion and testing, the previous comment in pg_locale.c
about avoiding this for performance reasons may have been mistaken
since it was testing a very different patch version way back when.
Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Discussion: https://www.postgresql.org/message-id/ed3baa81-7fac-7788-cc12-41e3f7917e34@enterprisedb.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b99ccd2cb2178b62b613edaf427fda8deace5bbf
Modified Files
--------------
src/backend/access/hash/hashfunc.c | 4 +-
src/backend/regex/regc_pg_locale.c | 40 +++++++--------
src/backend/utils/adt/formatting.c | 96 +++++++++++++++++-------------------
src/backend/utils/adt/like.c | 37 +++++++-------
src/backend/utils/adt/like_support.c | 27 +++++-----
src/backend/utils/adt/pg_locale.c | 3 --
src/backend/utils/adt/varchar.c | 26 +++++++---
src/backend/utils/adt/varlena.c | 34 ++++++++-----
8 files changed, 135 insertions(+), 132 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org
Subject: Re: pgsql: Call pg_newlocale_from_collation() also with default collation
In-Reply-To: <E1nATKK-0002dv-L1@gemulon.postgresql.org>
References: <E1nATKK-0002dv-L1@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox