libpq-how to add a schema to search path

Started by Divakar Singhover 13 years ago3 messagesgeneral
Jump to latest
#1Divakar Singh
dpsmails@yahoo.com

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.

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Divakar Singh (#1)
Re: libpq-how to add a schema to search path

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

#3Divakar Singh
dpsmails@yahoo.com
In reply to: Laurenz Albe (#2)
Re: libpq-how to add a schema to search path

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.albe@wien.gv.at> wrote:

From: Albe Laurenz <laurenz.albe@wien.gv.at>
Subject: RE: [GENERAL] libpq-how to add a schema to search path
To: "Divakar Singh *EXTERN*" <dpsmails@yahoo.com>, pgsql-general@postgresql.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