Re: a contrib function to query current locale values

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: a contrib function to query current locale values
Date: 2001-02-07 15:16:48
Message-ID: 28185.981559008@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(at)tm(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gunnar R|nning 2001-02-07 15:39:32 Re: full text searching
Previous Message Hannu Krosing 2001-02-07 13:48:08 Re: a contrib function to query current locale values