| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Netzach <psql-novice(at)netzach(dot)co(dot)il> | 
| Cc: | pgsql-novice(at)postgresql(dot)org | 
| Subject: | Re: Running .psqlrc from a custom location | 
| Date: | 2008-06-01 14:37:15 | 
| Message-ID: | 20003.1212331035@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-novice | 
Netzach <psql-novice(at)netzach(dot)co(dot)il> writes:
> I use a hack to make psql automatically set search_path to the relevant 
> schema for the dump directory I am currently working in. I achieved this 
> by running a wrapper script that changed the HOME environment variable, 
> setting a variable on the command line, and having the .psqlrc in the 
> custom location use that variable to set the search path. I just 
> upgraded to 8.1 from 7.4 and my hack stopped working - apparently psql 
> does not use the $HOME variable any more.
No, it doesn't, and changing $HOME is probably a pretty bad idea in any
case.
> My scripts are included below. I do not wish to run these commands every 
> time I use psql, only when I run it from the wrapper script. As far as I 
> am aware there is no way of setting search_path/schema from the command 
> line.
Try something like
	export PGOPTIONS="--search-path=foo,bar"
before starting psql.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Derrick Betts | 2008-06-01 14:49:15 | Re: Running .psqlrc from a custom location | 
| Previous Message | Netzach | 2008-06-01 09:27:12 | Running .psqlrc from a custom location |