From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Set COLLATE on a session level
Date: Mon, 30 Nov 2020 11:56:23 +0100
Message-ID: <X8TP169g6vgQrlm2@hermes.hilbert.loc> (raw)
In-Reply-To: <17384830-38E8-4F5C-92F9-338A1F1C6333@mikatiming.de>
References: <0DDE56FB-89A8-4621-BF5E-8CE3461F4983@mikatiming.de>
<9fd0eef06639e633e258461e5baad9734bcbc1ba.camel@cybertec.at>
<F4E0491C-0312-433D-9C5F-44730A43224B@mikatiming.de>
<CAFj8pRAk21ke-CQ5mDg8wAk2W=oc7fM6_9JvAvpbBOnJDz+kPQ@mail.gmail.com>
<20201120144717.GD5091@hermes.hilbert.loc>
<17384830-38E8-4F5C-92F9-338A1F1C6333@mikatiming.de>
Am Mon, Nov 30, 2020 at 10:11:38AM +0000 schrieb Dirk Mika:
> > 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
> This all seems unnecessarily complicated to me.
No one said it is going to be particularly convenient... You
asked for possible, I guess. :-)
Best,
Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: Karsten.Hilbert@gmx.net
Subject: Re: Set COLLATE on a session level
In-Reply-To: <X8TP169g6vgQrlm2@hermes.hilbert.loc>
References: <0DDE56FB-89A8-4621-BF5E-8CE3461F4983@mikatiming.de> <9fd0eef06639e633e258461e5baad9734bcbc1ba.camel@cybertec.at> <F4E0491C-0312-433D-9C5F-44730A43224B@mikatiming.de> <CAFj8pRAk21ke-CQ5mDg8wAk2W=oc7fM6_9JvAvpbBOnJDz+kPQ@mail.gmail.com> <20201120144717.GD5091@hermes.hilbert.loc> <17384830-38E8-4F5C-92F9-338A1F1C6333@mikatiming.de> <X8TP169g6vgQrlm2@hermes.hilbert.loc>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox