Howdy,

Environment:

Solaris 10
Postgres 8.3.11

I'm running a dump/restore in a shell script.  There are 3 machines involved.  
Host1 where the shell script is being run from, host2 where the database is 
being dumped from, host3 where the database is being restored to.  Shell script 
looks like this:

/usr/postgres/8.3/bin/pg_dump -h <host2> <database> | 
/usr/postgres/8.3/bin/psql -h <host3> <database>

I want to restore into a specific schema.  Psql does not provide a switch for 
this.  I tried this before the pg_dump command above:

Echo "
SET search_path TO <schema>;
" | /usr/postgres/8.3/bin/psql -h <host3> <database>

Which didn't work.  I also tried this before the pg_dump command:

PGOPTIONS="-search_path=<schema>"

Which doesn't work due to the script running from a different machine.

Does anyone have any ideas on how I can achieve this, please?

Thank you,

Sam


Reply via email to