Re: Set COLLATE on a session level

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: Set COLLATE on a session level
Дата
Msg-id 20201120144717.GD5091@hermes.hilbert.loc
обсуждение исходный текст
Ответ на Re: Set COLLATE on a session level  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Set COLLATE on a session level  (Dirk Mika <Dirk.Mika@mikatiming.de>)
Список pgsql-general
On Fri, Nov 20, 2020 at 03:32:48PM +0100, Pavel Stehule wrote:

> pá 20. 11. 2020 v 15:28 odesílatel Dirk Mika <Dirk.Mika@mikatiming.de>
> napsal:
>
> > Let's assume there is an app that accesses the same database from
> > different countries. And in this app data should be displayed ordered. And
> > the sort order is not identical in all countries.
> >
> > Does the app have to send different SQL commands depending on the country?
> > Not nice.
> > Do the data have to be sorted in the app? Not nice either.
> >
>
> the query is the same - you just use a different COLLATE clause. For
> Postgres there is not any other way.

One might use a function producing a SELECT taking the locale as a parameter.

Or views in schemas per locale. Selecting the search path
per locale pulls in the right view.

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Set COLLATE on a session level
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: AW: Linux package upgrade without dependency conflicts