> I've never tried that, but have you experimented with setting the schema
> from the .psqlrc file? If you can do that then you might be able to get
> .psqlrc to set the schema to a variable which you have set using the -v
> command-line option.
Ingenious. Works a dream. Here are the details of how I did it just in
case somebody else is interested:
begin ~/.psqlrc --------
SET search_path TO :schema;
end file ------------------
mycomputer:~$ psql -v schema=myschema mydb
Welcome to psql 7.old.reallyold, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
SET
mydb=> \dt
List of relations
Schema | Name | Type | Owner
--------------+------------------------------+-------+--------
myschema | table1 | table | me
myschema | table2 | table | me
myschema | table3 | table | me