OSDN Git Service

Fix up handling of C/POSIX collations.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Mar 2011 16:43:39 +0000 (12:43 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 20 Mar 2011 16:44:13 +0000 (12:44 -0400)
commit176d5bae1d636fc1e91840b12cbd04c96d638b7e
treef861d3f9d9eb2bead0cd932e7825271fb1fbc1e1
parentc2f4ea469b52e6f7fedff651a4aa0acced873a5f
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.
doc/src/sgml/charset.sgml
src/backend/utils/adt/formatting.c
src/backend/utils/adt/pg_locale.c
src/bin/initdb/initdb.c
src/include/catalog/catversion.h
src/include/catalog/pg_collation.h
src/include/port.h
src/port/pgstrcasecmp.c