Re: How to add locale support for each column? - Mailing list pgsql-hackers

From Greg Stark
Subject Re: How to add locale support for each column?
Date
Msg-id 87ekkykzso.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: How to add locale support for each column?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: How to add locale support for each column?  (Dennis Bjorklund <db@zigo.dhs.org>)
Re: How to add locale support for each column?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:

> 2) switching the locale at run time is too expensive when using the system
> library.

Fwiw I did some experiments with this and found it wasn't true. At least with
glibc I could switch the locale to what I wanted and back for every record in
a million record table with basically no noticeable effect on the query
execution time.

Of course not every system will have an equally speedy implementation. But I
don't think that's an argument for postgres to reimplement portions of the OS.
If the OS locale handling is slow on some OS's then postgres should just warn
its users that using locales on those OS's will be slow.

In any case I suspect more than just the glibc implementation cache locales in
memory at this point. It seems like just too obvious a feature and more and
more applications require locale switching to be fast anyways.

-- 
greg



pgsql-hackers by date:

Previous
From: "Michael Paesold"
Date:
Subject: Re: SAVEPOINT SQL conformance
Next
From: "Michael Paesold"
Date:
Subject: Re: [GENERAL] Rollback on Error