Search Postgresql Archives

Re: Set search_path for session

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mary Sipple wrote:
> We have a script wrapper for psql which reads a configuration file and
> constructs a psql command to connect to the configured instance of postgres.
> We would like to include a search_path setting in the configuraration file
> and have the wrapper use that to set the search_path for the psql session. I
> tried using the -v flag (-vsearch_path=xxxx) with the psql command but that
> did not work:
> 
> > psql -h$SOCKET -U$USER -p$PORT -vsearch_path=$SCHEMAS $DBNAME

This should work:

export PGOPTIONS="-c search_path=$SCHEMAS"
psql -h$SOCKET -U$USER -p$PORT $DBNAME

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux