Re: Set COLLATE on a session level - Mailing list pgsql-general

From Dirk Mika
Subject Re: Set COLLATE on a session level
Date
Msg-id CB2536E7-FCBA-41A1-A6BA-30F2313AAF5D@mikatiming.de
Whole thread Raw
In response to Re: Set COLLATE on a session level  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Responses Re: Set COLLATE on a session level
List pgsql-general
> > > Or views in schemas per locale. Selecting the search path
> > > per locale pulls in the right view.
> >
> > And one view per locale would mean that I would have to
> > create a whole schema including all views for each locale I
> > want to support. I would have to roll out a new version of
> > the data model, just for an additional locale.
>
> Or a "smart" view. Set a session variable before running the
> query and have the (one) view return the locale'd data based
> on the session variable ...
>
>set session "mika.current_locale" = 'locale@2_use';
>
> and use
>
>select current_setting('mika.current_locale')
>
> as needed inside the view definition

I'll take a look at that. Thank you very much for the idea.

>
> > This all seems unnecessarily complicated to me.
>
> No one said it is going to be particularly convenient...  You
> asked for possible, I guess. :-)

My sentence was more along the lines that I cannot imagine that I am the first to have this problem and that there
shouldtherefore be an easier solution. But apparently the topic is not so relevant in general. 😉
 

BR
Dirk


--
Dirk Mika
Software Developer

mika:timing GmbH
Strundepark - Kürtener Str. 11b
51465 Bergisch Gladbach
Germany

fon +49 2202 2401-1197
dirk.mika@mikatiming.de
www.mikatiming.de

AG Köln HRB 47509 * WEEE-Reg.-Nr. DE 90029884
Geschäftsführer: Harald Mika, Jörg Mika



pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Postgres C-API: How to get the Oid for a custom type defined in a schema outside of the current search path
Next
From: charles meng
Date:
Subject: Re: Alter the column data type of the large data volume table.