Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DF1FF1337B39 for ; Tue, 30 Nov 2010 01:16:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 19313-01 for ; Tue, 30 Nov 2010 05:16:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from imail.internode.com.au (exchht01-ext.internode.com.au [203.26.95.185]) by mail.postgresql.org (Postfix) with ESMTP id 3C3131335B36 for ; Tue, 30 Nov 2010 01:16:13 -0400 (AST) Received: from EXCHMAIL.staff.internode.com.au ([169.254.2.207]) by exchht01.staff.internode.com.au ([::1]) with mapi; Tue, 30 Nov 2010 15:46:09 +1030 From: Samuel Stearns To: "pgsql-admin@postgresql.org" Date: Tue, 30 Nov 2010 15:46:07 +1030 Subject: Setting Schema on Restore Thread-Topic: Setting Schema on Restore Thread-Index: AcuQTbF3Ap9IhHmHQ4moyOoT+/EVCw== Message-ID: <68B59BEDCD36854AADBDF17E91B2937A0784188839@EXCHMAIL.staff.internode.com.au> Accept-Language: en-US, en-AU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-AU Content-Type: multipart/alternative; boundary="_000_68B59BEDCD36854AADBDF17E91B2937A0784188839EXCHMAILstaff_" MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/246 X-Sequence-Number: 36212 --_000_68B59BEDCD36854AADBDF17E91B2937A0784188839EXCHMAILstaff_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Howdy, Environment: Solaris 10 Postgres 8.3.11 I'm running a dump/restore in a shell script. There are 3 machines involve= d. Host1 where the shell script is being run from, host2 where the databas= e is being dumped from, host3 where the database is being restored to. She= ll script looks like this: /usr/postgres/8.3/bin/pg_dump -h | /usr/postgres/8.3/bin= /psql -h I want to restore into a specific schema. Psql does not provide a switch f= or this. I tried this before the pg_dump command above: Echo " SET search_path TO ; " | /usr/postgres/8.3/bin/psql -h Which didn't work. I also tried this before the pg_dump command: PGOPTIONS=3D"-search_path=3D" 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 --_000_68B59BEDCD36854AADBDF17E91B2937A0784188839EXCHMAILstaff_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Howdy,

 

Environ= ment:

 

Solaris 10

Postgres 8.3.11<= /o:p>

 

I&#= 8217;m running a dump/restore in a shell script.  There are 3 machines= involved.  Host1 where the shell script is being run from, host2 wher= e the database is being dumped from, host3 where the database is being rest= ored to.  Shell script looks like this:

 

/usr/postgres/8.3/bin/pg_dum= p -h <host2> <database> | /usr/postgres/8.3/bin/psql -h <hos= t3> <database>

 

I want to restore into a specific schema.  P= sql does not provide a switch for this.  I tried this before the pg_du= mp command above:

 

<= p class=3DMsoNormal>Echo “

SET sea= rch_path TO <schema>;

“ | /u= sr/postgres/8.3/bin/psql -h <host3> <database>

 

Which didnR= 17;t work.  I also tried this before the pg_dump command:

 

PGOPTIONS= =3D”—search_path=3D<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=

 

&nb= sp;

= --_000_68B59BEDCD36854AADBDF17E91B2937A0784188839EXCHMAILstaff_--