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@xxxxxxxxxxxxx> > 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