From: | Brent Wood <Brent(dot)Wood(at)niwa(dot)co(dot)nz> |
---|---|
To: | itishree sukla <itishree(dot)sukla(at)gmail(dot)com> |
Cc: | Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Multiple Schema in One DB |
Date: | 2014-02-27 18:24:14 |
Message-ID: | B30242D206AB9543A3406649674DB419C35413D9@welwexmb02.niwa.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
We use this script as a proxy for psql, the user can run this followed by the schema's they want in the search path on the command line & the PGOPTIONS value sets it up for them...
schema=`echo $@|sed 's/, /,/g'|tr " " ","|sed 's/,,/,/g'`
#echo $schema
export PGOPTIONS="-c search_path=$schema,public,maps"
psql fish
In your case this could perhaps be used by each application to customise the run time environment, so each has it's own PGOPTIONS string, and thus, when Postgres is run, it's own search path.
Brent Wood
Programme leader: Environmental Information Delivery
NIWA
DDI: +64 (4) 3860529
________________________________________
From: pgsql-general-owner(at)postgresql(dot)org [pgsql-general-owner(at)postgresql(dot)org] on behalf of Scott Marlowe [scott(dot)marlowe(at)gmail(dot)com]
Sent: Thursday, February 27, 2014 7:32 PM
To: itishree sukla
Cc: Postgres General
Subject: Re: [GENERAL] Multiple Schema in One DB
On Wed, Feb 26, 2014 at 11:24 PM, itishree sukla
<itishree(dot)sukla(at)gmail(dot)com> wrote:
> Hi all,
>
> I am in a requirement to have multiple schema in one Database.
>
> Schema structure will be same with respect to DB all db objetcs like tables,
> procedure.
>
> However each schema will be accessed by one one application.
>
> Problem is as all DB objects are same, when application is calling to a
> schema we have set search_path='schema name' in our procedure level. Now we
> want to get rid of that.
>
> I know we have do it based on ROLE Level, question is having more than one
> user defined schema is it achievable, i have done a small exercise, seems to
> be it is taking the first schema defined in the set search_path.
>
> As i am in urgent need of it, please help me.
You can alter user to each one have their own search path.
--
Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
--
Please consider the environment before printing this email.
NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Janes | 2014-02-27 18:46:28 | Re: Doubts after evaluating Xlogdump |
Previous Message | Adrian Klaver | 2014-02-27 17:47:15 | Re: Issue with default values and Rule |