public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: intmail01 <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: How to choose table in SELECT clause without schema qualifier or 'set local'
Date: Fri, 22 Mar 2024 06:28:42 -0700
Message-ID: <CAKFQuwbpYt=P2RudjAs_ZMUHZEO9PWrVcBhX9bR7GRUvTHPu+Q@mail.gmail.com> (raw)
In-Reply-To: <CAKJANSDpz7TXn30vv1HVSjRv0N+xSnyiSnfyMdFaeXh1_yfFuw@mail.gmail.com>
References: <CAKJANSDpz7TXn30vv1HVSjRv0N+xSnyiSnfyMdFaeXh1_yfFuw@mail.gmail.com>
On Friday, March 22, 2024, intmail01 <[email protected]> wrote:
> Hi,
>
> My db have many schemas (company name) and there are SELECT code related
> to tables that I distribute for each company users.
>
> The structure inside are the same for all schemas.
>
> It is a nightmare to change code each time to modify the schema qualifier
> or SET LOCAL search_path when I add a new company.
> Is there command, configurations or any trick to not modify code each time
> I add company then code can works for any schema.
>
>
Do multi-tenant via partitioning and a tenant_id column instead of by
schema.
Otherwise, maybe attach a custom search_path value to the logon user each
company uses? See “alter role … set”. But it is search_path you need to
be using.
David J.
view thread (2+ messages)
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: How to choose table in SELECT clause without schema qualifier or 'set local'
In-Reply-To: <CAKFQuwbpYt=P2RudjAs_ZMUHZEO9PWrVcBhX9bR7GRUvTHPu+Q@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox