Re: libpq-how to add a schema to search path

Lists: pgsql-general
From: Divakar Singh <dpsmails(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: libpq-how to add a schema to search path
Date: 2012-10-10 10:11:52
Message-ID: 1349863912.73756.YahooMailClassic@web160602.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

While making connection to PGSQL using libpq, is there any option to mention the schema name?
Something similar exists in java, however not sure about libpq.
http://stackoverflow.com/questions/4168689/is-it-possible-to-specify-schema-when-connecting-to-postgres-with-jdbc

Thanks in advance for help.


From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Divakar Singh *EXTERN*" <dpsmails(at)yahoo(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: libpq-how to add a schema to search path
Date: 2012-10-10 10:31:27
Message-ID: D960CB61B694CF459DCFB4B0128514C20886AD46@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Divakar Singh wrote:
> While making connection to PGSQL using libpq, is there any option to
mention the schema name?
> Something similar exists in java, however not sure about libpq.

Use the "options" connection parameter, like this:

psql "dbname=test user=laurenz port=5432 options='-c
search_path=schema1,schema2'"

Yours,
Laurenz Albe


From: Divakar Singh <dpsmails(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Subject: Re: libpq-how to add a schema to search path
Date: 2012-10-10 15:28:44
Message-ID: 1349882924.34899.YahooMailClassic@web160605.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi Laurenz,
Thanks for quick reply.
I hope it will help. Will check and revert.

Best Regards,
dpsmails

--- On Wed, 10/10/12, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> wrote:

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Subject: RE: [GENERAL] libpq-how to add a schema to search path
To: "Divakar Singh *EXTERN*" <dpsmails(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Date: Wednesday, October 10, 2012, 4:01 PM

Divakar Singh wrote:
> While making connection to PGSQL using libpq, is there any option to
mention the schema name?
> Something similar exists in java, however not sure about libpq.

Use the "options" connection parameter, like this:

psql "dbname=test user=laurenz port=5432 options='-c
search_path=schema1,schema2'"

Yours,
Laurenz Albe