Re: Issues with german locale on CentOS 5,6,7

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Issues with german locale on CentOS 5,6,7
Дата
Msg-id 8b22d3e2-2d09-4ff0-8c95-bd67e011ea13@mm
обсуждение исходный текст
Ответ на Re: Issues with german locale on CentOS 5,6,7  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-general
    Thomas Kellerer wrote:

> I always thought that this is a major shortcoming (if not a bug) in Postgres
> that the collation support is left to the OS.
>
> Because it essentially means that that exactly the same query with exactly
> the same data might return a different result if run on different OS

Could an extension help with this?

CREATE EXTENSION pg_locales;

The extension would provide its own strcoll/strxfrm/etc. and a set
of locale definitions, presumably slurped from Linux or BSD.

It would probably be preloaded in postgresql.conf:
shared_preload_libraries = pg_locales

A collation would be created with
SELECT create_pg_collation(name,locale,lc_collate,lc_ctype);
which would be a kind of CREATE COLLATION but relying on the
extension code/data rather than the libc.

Then tables and columns could be set to use that collation, and the
core postgres code should divert the corresponding string comparisons
to the extension functions.

Benefits:
- being insulated from unexpected OS changes.
- portability across OS, assuming that the extension would be itself
portable.
- the core postgres would not be responsible of maintaining these locales.

Would something like that make sense?

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


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

Предыдущее
От: Vick Khera
Дата:
Сообщение: Re: Best practices for aggregate table design
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: postgres standby won't start