Re: a contrib function to query current locale values

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: a contrib function to query current locale values
Дата
Msg-id 28185.981559008@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: a contrib function to query current locale values  (Hannu Krosing <hannu@tm.ee>)
Список pgsql-hackers
Hannu Krosing <hannu@tm.ee> writes:
> BTW, does anyone know if setlocale() is an expensive function ?

The variant where you're just querying the current setting should not be
too expensive.  I'd expect the variant where you are changing the
setting to be very expensive, however; most likely, it goes out and
reads/parses the locale definition files.

> I.e. would it be a huge performance hog if called before each and every 
> compare of each and every VARCHAR() or TEXT field that has COLLATE defined.

I do not think we will be able to get away with that in standard
implementations of the locale functions.  We will need to roll our own
implementation that caches and reuses pre-loaded locale information for
multiple locales at once.

Doesn't seem like an appetizing prospect, but I think there's no other
way to support per-column locales...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: a contrib function to query current locale values
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Re: [GENERAL] MySQL -> Postgres dump converter