pgsql: Fix up handling of C/POSIX collations.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix up handling of C/POSIX collations.
Date: 2011-03-20 16:44:25
Message-ID: E1Q1Ljt-000473-Oi@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix up handling of C/POSIX collations.

Install just one instance of the "C" and "POSIX" collations into
pg_collation, rather than one per encoding. Make these instances exist
and do something useful even in machines without locale_t support: to wit,
it's now possible to force comparisons and case-folding functions to use C
locale in an otherwise non-C database, whether or not the platform has
support for using any additional collations.

Fix up severely broken upper/lower/initcap functions, too: the C/POSIX
fastpath now does what it is supposed to, and non-default collations are
handled correctly in single-byte database encodings.

Merge the two separate collation hashtables that were being maintained in
pg_locale.c, and be more wary of the possibility that we fail partway
through filling a cache entry.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/176d5bae1d636fc1e91840b12cbd04c96d638b7e

Modified Files
--------------
doc/src/sgml/charset.sgml | 140 ++++++++---
src/backend/utils/adt/formatting.c | 163 ++++++++++--
src/backend/utils/adt/pg_locale.c | 488 ++++++++++++++++++++----------------
src/bin/initdb/initdb.c | 18 +-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_collation.h | 15 +-
src/include/port.h | 2 +
src/port/pgstrcasecmp.c | 26 ++
8 files changed, 572 insertions(+), 282 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-03-20 17:35:00 pgsql: Suppress platform-dependent unused-variable warning.
Previous Message Bruce Momjian 2011-03-20 13:34:02 pgsql: Move PITR and StreamingRep up one level of heading in the 9.1 re