Re: Set search_path for session

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Mary Sipple <msipple(at)iii(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Set search_path for session
Date: 2009-04-17 16:21:56
Message-ID: 20090417162156.GG7709@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Irene Barg 2009-04-17 16:27:09 number of relations reported by vacuumdb -av
Previous Message stevefoss 2009-04-17 16:19:31 Migration/Upgrade Problems