Re: Proof of concept COLLATE support with patch - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Proof of concept COLLATE support with patch
Date
Msg-id 87u0h1ygu5.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Proof of concept COLLATE support with patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proof of concept COLLATE support with patch
Re: Proof of concept COLLATE support with patch
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Greg Stark <gsstark@mit.edu> writes:
> > I still doesn't get where the hostility towards this functionality comes from.
> 
> We're not really willing to say "here is a piece of syntax REQUIRED
> BY THE SQL SPEC which we only support on some platforms".  readline,
> O_DIRECT, and the like are a completely inappropriate analogy, because
> those are inherently platform-dependent (and not in the spec).

But that's not the case at all. The syntax can be supported everywhere it
would just be somewhat faster on some platforms than others. It's already
reasonably fast on any platform that caches locale information which includes
glibc and presumably other free software libcs. It would be slightly faster if
there are _l functions. And much slower if the libc setlocale implementation
is braindead. But there's nothing wrong with saying "it's slow because your
libc is slow. Compile with this freely available library which has a better
implementation". The programming syntax would still be exactly 100% the same.

> The objection is fundamentally that a platform-specific implementation
> cannot be our long-term goal, and so expending effort on creating one
> seems like a diversion.  If there were a plan put forward showing how
> this is just a useful way-station, and we could see how we'd later get
> rid of the glibc dependency without throwing away the work already done,
> then it would be a different story.

It's not like the actual calls to setlocale are going to be much code. One day
presumably some variant of these _l functions will become entirely standard.
In which case you're talking about potentially "throwing away" 50 lines of
code. The bulk of the code is going to be parsing and implementing the actual
syntax and behaviour of the SQL spec. And in any case I wouldn't expect it to
ever get thrown away. There will be people compiling on RH9 or similar vintage
systems for a long time.

-- 
greg



pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Locale implementation questions (was: Proof of concept COLLATE support with patch)
Next
From: Greg Stark
Date:
Subject: Re: Locale implementation questions (was: Proof of concept COLLATE support with patch)