Re: Locale implementation questions (was: Proof of concept COLLATE support with patch) - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Locale implementation questions (was: Proof of concept COLLATE support with patch)
Date
Msg-id 87oe79ygfh.fsf@stark.xeocode.com
Whole thread Raw
In response to Locale implementation questions (was: Proof of concept COLLATE support with patch)  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Locale implementation questions (was: Proof of concept COLLATE support with patch)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:

> 2. Locale data needs to be combined with a charset and compiled to work
> with the library. PostgreSQL supports at least 15 charsets but we don't
> want to ship compiled versions of all of these (Debian learnt that the
> hard way). So, how do we generate the files people need.

That's just one of many lessons learned the hard way by distributions. Nor
will it be the last innovation in this area.

I really find this instinct of wanting to reimplement large swaths of the OS
inside Postgres (and annoying detail-ridden swaths that are hard to get right
and continually evolving too) to be a bad idea.

I can't believe it's harder to maintain an 

#ifdef HAVE_STRCOL_L
#else
#endif

than it is to try to maintain an entire independent locale library. Nor is it
simpler for sysadmins to have to maintain an entirely separate set of locales
independently from the system locales.

If you really are unhappy enough with OS setlocale implementations to want to
try to do this then it would be more helpful to do it outside of Postgres.
Package up the Apple setlocale library as a separate package that anyone can
install on Solaris, BSD, Linux or whatever. Then Postgres can just say "it
works fine with your OS library but your OS library might be very slow. Here's
a third-party library that you can install that is fast and may relieve any
problems you have with collation performance."

But I think that's getting ahead of things. Until Postgres even supports
collations using the OS libraries you won't even know if that's even
necessary.

-- 
greg



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Proof of concept COLLATE support with patch
Next
From: "Ilan Rabinovitch"
Date:
Subject: OT: SCALE 4x -- Call For Papers