troubled by pg_dump and pg_restore

--0-78956169-1274224489=:64826
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Everybody,

I am a bit troubled by pg_dump and pg_restore.=A0 My platform is
redhat linux, Del 64 bit hardware, running postgres 8.3.7.
I have a database named canon and I want to move a schema full of
tables from canon to a new database named musket.=A0 The schema I
am interested in is called tsakai.=A0 Here's what I have done:

=A0 $ env | grep PG
=A0 PGUSER=3Dpostgres
=A0 PGDATABASE=3Dcanon
=A0 PGHOST=3Dlocalhost
=A0 PGDATA=3D/usr/local/pgsql/data
=A0 $
=A0 $ pg_dump -n tsakai > canon_tsakai.sql
=A0 $
=A0 $ echo $?
=A0 0
=A0 $
=A0 $ pg_restore -l canon_tsakai.sql
=A0 pg_restore: [archiver] input file does not appear to be a valid archive
=A0 $
=A0 $ pg_restore -d musket canon_tsakai.sql
=A0 pg_restore: [archiver] input file does not appear to be a valid archive

Can someone please tell me (1) if there is anything wrong with my invocatio=
n
of pd_dump?=A0 (I want to generate a file pd_restore can use to feed to
musket database.)=A0 (2) Why pg_restore wouldn't give me listing?=A0 And (3=
)
why the second pg_restore command is upset?

Thank you.

Regards,

Tena sakai
--0-78956169-1274224489=:64826
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">Hi Everybody,<br><br>I am a bit troubled by p=
g_dump and pg_restore.  My platform is<br>redhat linux, Del 64 bit har=
dware, running postgres 8.3.7.<br>I have a database named canon and I want =
to move a schema full of<br>tables from canon to a new database named muske=
t.  The schema I<br>am interested in is called tsakai.  Here's wh=
at I have done:<br><br>  $ env | grep PG<br>  PGUSER=3Dpostgres<b=
r>  PGDATABASE=3Dcanon<br>  PGHOST=3Dlocalhost<br>  PGDATA=
=3D/usr/local/pgsql/data<br>  $<br>  $ pg_dump -n tsakai > can=
on_tsakai.sql<br>  $<br>  $ echo $?<br>  0<br>  $<br>&n=
bsp; $ pg_restore -l canon_tsakai.sql<br>  pg_restore: [archiver] inpu=
t file does not appear to be a valid archive<br>  $ <br>  $ pg_re=
store -d musket canon_tsakai.sql<br>  pg_restore: [archiver] input fil=
e does not
appear to be a valid archive<br><br>Can someone please tell me (1) if ther=
e is anything wrong with my invocation<br>of pd_dump?  (I want to gene=
rate a file pd_restore can use to feed to<br>musket database.)  (2) Wh=
y pg_restore wouldn't give me listing?  And (3)<br>why the second pg_r=
estore command is upset?<br><br>Thank you.<br><br>Regards,<br><br>Tena saka=
i</td></tr></table>
--0-78956169-1274224489=:64826--
Tena Sakai [ Mi, 19 Mai 2010 01:14 ] [ ID #2041670 ]

Re: troubled by pg_dump and pg_restore

--001636137b0cbec9e80486e697c0
Content-Type: text/plain; charset=ISO-8859-1

On Tue, May 18, 2010 at 5:14 PM, Tena Sakai <sakaitena [at] yahoo.com> wrote:

>
> Can someone please tell me (1) if there is anything wrong with my
> invocation
> of pd_dump? (I want to generate a file pd_restore can use to feed to
> musket database.) (2) Why pg_restore wouldn't give me listing? And (3)
> why the second pg_restore command is upset?
>

Someone please correct me if I'm wrong, but I believe -l only makes sense in
the context of a dump created with -Fc. For SQL format dumps, I usually
just cat or \i them into psql.

rls

--
:wq

--001636137b0cbec9e80486e697c0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Tue, May 18, 2010 at 5:14 PM, Tena Sakai <span dir=3D"ltr"><<a href=
=3D"mailto:sakaitena [at] yahoo.com">sakaitena [at] yahoo.com</a>></span> wrote:<b=
r><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0"><tbody><tr><td vali=
gn=3D"top" style=3D"font:inherit"><br>Can someone please tell me (1) if the=
re is anything wrong with my invocation<br>of pd_dump?=A0 (I want to genera=
te a file pd_restore can use to feed to<br>
musket database.)=A0 (2) Why pg_restore wouldn't give me listing?=A0 An=
d (3)<br>why the second pg_restore command is upset?<br></td></tr></tbody><=
/table></blockquote></div><div><br></div><div>Someone please correct me if =
I'm wrong, but I believe -l only makes sense in the context of a dump c=
reated with -Fc. =A0For SQL format dumps, I usually just cat or \i them int=
o psql.</div>
<div><br></div><div>rls</div><br>-- <br>:wq<br>

--001636137b0cbec9e80486e697c0--
Rosser Schwarz [ Mi, 19 Mai 2010 01:20 ] [ ID #2041671 ]

Re: troubled by pg_dump and pg_restore

--_000_68B59BEDCD36854AADBDF17E91B2937A01A54D117EEXCHMAILsta ff_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Try this:

pg_dump -n tsakai canon | psql musket

Sam

________________________________
From: pgsql-admin-owner [at] postgresql.org [mailto:pgsql-admin-owner [at] postgresql=
..org] On Behalf Of Tena Sakai
Sent: Wednesday, 19 May 2010 8:45 AM
To: pgsql-admin [at] postgresql.org
Subject: [ADMIN] troubled by pg_dump and pg_restore

Hi Everybody,

I am a bit troubled by pg_dump and pg_restore. My platform is
redhat linux, Del 64 bit hardware, running postgres 8.3.7.
I have a database named canon and I want to move a schema full of
tables from canon to a new database named musket. The schema I
am interested in is called tsakai. Here's what I have done:

$ env | grep PG
PGUSER=3Dpostgres
PGDATABASE=3Dcanon
PGHOST=3Dlocalhost
PGDATA=3D/usr/local/pgsql/data
$
$ pg_dump -n tsakai > canon_tsakai.sql
$
$ echo $?
0
$
$ pg_restore -l canon_tsakai.sql
pg_restore: [archiver] input file does not appear to be a valid archive
$
$ pg_restore -d musket canon_tsakai.sql
pg_restore: [archiver] input file does not appear to be a valid archive

Can someone please tell me (1) if there is anything wrong with my invocatio=
n
of pd_dump? (I want to generate a file pd_restore can use to feed to
musket database.) (2) Why pg_restore wouldn't give me listing? And (3)
why the second pg_restore command is upset?

Thank you.

Regards,

Tena sakai



--_000_68B59BEDCD36854AADBDF17E91B2937A01A54D117EEXCHMAILsta ff_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" xmlns=3D"http://ww=
w.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
..shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" name=3D"City"/=
>
<o:SmartTagType namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place"/>
<o:SmartTagType namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
[at] page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-AU link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Try this:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'>pg_dump –n tsakai canon | psql
musket<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Sam<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span style=
=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font siz=
e=3D3
face=3D"Times New Roman"><span lang=3DEN-US style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span lang=3DEN-US
style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bol d'>From:</span>=
</font></b><font
size=3D2 face=3DTahoma><span lang=3DEN-US style=3D'font-size:10.0pt;font-fa=
mily:Tahoma'>
pgsql-admin-owner [at] postgresql.org [mailto:pgsql-admin-owner [at] postgresql.org] =
<b><span
style=3D'font-weight:bold'>On Behalf Of </span></b>Tena Sakai<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Wednesday, 19 May 2010=
8:45
AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> <st1:PersonName w:st=3D"=
on">pgsql-admin [at] postgresql.org</st1:PersonName><br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> [ADMIN] troubled by
pg_dump and pg_restore</span></font><span lang=3DEN-US><o:p></o:p></span></=
p>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span style=3D=
'font-size:
12.0pt'><o:p> </o:p></span></font></p>

<table class=3DMsoNormalTable border=3D0 cellspacing=3D0 cellpadding=3D0>
<tr>
<td valign=3Dtop style=3D'padding:0cm 0cm 0cm 0cm'>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span
style=3D'font-size:12.0pt'>Hi Everybody,<br>
<br>
I am a bit troubled by pg_dump and pg_restore.  My platform is<br>
redhat linux, Del 64 bit hardware, running postgres 8.3.7.<br>
I have a database named canon and I want to move a schema full of<br>
tables from canon to a new database named musket.  The schema I<br>
am interested in is called tsakai.  Here's what I have done:<br>
<br>
  $ env | grep PG<br>
  PGUSER=3Dpostgres<br>
  PGDATABASE=3Dcanon<br>
  PGHOST=3Dlocalhost<br>
  PGDATA=3D/usr/local/pgsql/data<br>
  $<br>
  $ pg_dump -n tsakai > canon_tsakai.sql<br>
  $<br>
  $ echo $?<br>
  0<br>
  $<br>
  $ pg_restore -l canon_tsakai.sql<br>
  pg_restore: [archiver] input file does not appear to be a valid
archive<br>
  $ <br>
  $ pg_restore -d musket canon_tsakai.sql<br>
  pg_restore: [archiver] input file does not appear to be a valid
archive<br>
<br>
Can someone please tell me (1) if there is anything wrong with my invocat=
ion<br>
of pd_dump?  (I want to generate a file pd_restore can use to feed t=
o<br>
musket database.)  (2) Why pg_restore wouldn't give me listing? =
;
And (3)<br>
why the second pg_restore command is upset?<br>
<br>
Thank you.<br>
<br>
Regards,<br>
<br>
Tena <st1:City w:st=3D"on"><st1:place w:st=3D"on">sakai</st1:place></st1:=
City><o:p></o:p></span></font></p>
</td>
</tr>
</table>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span style=3D=
'font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

</body>

</html>

--_000_68B59BEDCD36854AADBDF17E91B2937A01A54D117EEXCHMAILsta ff_--
Samuel Stearns [ Mi, 19 Mai 2010 01:24 ] [ ID #2041672 ]

Re: troubled by pg_dump and pg_restore

(Please stick to plain text posts, as many readers can't read html or
the formatting gets screwy. This is a plain text mailing list in
general. Attachments are ok tho)

On Tue, May 18, 2010 at 5:14 PM, Tena Sakai <sakaitena [at] yahoo.com> wrote:
>
> Hi Everybody,
>
> I am a bit troubled by pg_dump and pg_restore.=A0 My platform is
> redhat linux, Del 64 bit hardware, running postgres 8.3.7.
> I have a database named canon and I want to move a schema full of
> tables from canon to a new database named musket.=A0 The schema I
> am interested in is called tsakai.=A0 Here's what I have done:
>
> =A0 $ env | grep PG
> =A0 PGUSER=3Dpostgres
> =A0 PGDATABASE=3Dcanon
> =A0 PGHOST=3Dlocalhost
> =A0 PGDATA=3D/usr/local/pgsql/data
> =A0 $
> =A0 $ pg_dump -n tsakai > canon_tsakai.sql
> =A0 $
> =A0 $ echo $?
> =A0 0
> =A0 $
> =A0 $ pg_restore -l canon_tsakai.sql
> =A0 pg_restore: [archiver] input file does not appear to be a valid archi=
ve
> =A0 $
> =A0 $ pg_restore -d musket canon_tsakai.sql
> =A0 pg_restore: [archiver] input file does not appear to be a valid archi=
ve
>
> Can someone please tell me (1) if there is anything wrong with my invocat=
ion
> of pd_dump?=A0 (I want to generate a file pd_restore can use to feed to
> musket database.)=A0 (2) Why pg_restore wouldn't give me listing?=A0 And =
(3)
> why the second pg_restore command is upset?

pg_restore expects custom format from pg_dump. For plain sql files, use p=
sql:

psql mydb -f mysql.sql

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Scott Marlowe [ Mi, 19 Mai 2010 01:26 ] [ ID #2041673 ]

Re: troubled by pg_dump and pg_restore

Many thanks, Rosser, Sam, and Scott.

Regards,

Tena Sakai
tsakai [at] gallo.ucsf.edu


On 5/18/10 4:26 PM, "Scott Marlowe" <scott.marlowe [at] gmail.com> wrote:

> (Please stick to plain text posts, as many readers can't read html or
> the formatting gets screwy. This is a plain text mailing list in
> general. Attachments are ok tho)
>
> On Tue, May 18, 2010 at 5:14 PM, Tena Sakai <sakaitena [at] yahoo.com> wrote:
>>
>> Hi Everybody,
>>
>> I am a bit troubled by pg_dump and pg_restore.=A0 My platform is
>> redhat linux, Del 64 bit hardware, running postgres 8.3.7.
>> I have a database named canon and I want to move a schema full of
>> tables from canon to a new database named musket.=A0 The schema I
>> am interested in is called tsakai.=A0 Here's what I have done:
>>
>> =A0 $ env | grep PG
>> =A0 PGUSER=3Dpostgres
>> =A0 PGDATABASE=3Dcanon
>> =A0 PGHOST=3Dlocalhost
>> =A0 PGDATA=3D/usr/local/pgsql/data
>> =A0 $
>> =A0 $ pg_dump -n tsakai > canon_tsakai.sql
>> =A0 $
>> =A0 $ echo $?
>> =A0 0
>> =A0 $
>> =A0 $ pg_restore -l canon_tsakai.sql
>> =A0 pg_restore: [archiver] input file does not appear to be a valid arch=
ive
>> =A0 $
>> =A0 $ pg_restore -d musket canon_tsakai.sql
>> =A0 pg_restore: [archiver] input file does not appear to be a valid arch=
ive
>>
>> Can someone please tell me (1) if there is anything wrong with my invoca=
tion
>> of pd_dump?=A0 (I want to generate a file pd_restore can use to feed to
>> musket database.)=A0 (2) Why pg_restore wouldn't give me listing?=A0 And=
(3)
>> why the second pg_restore command is upset?
>
> pg_restore expects custom format from pg_dump. For plain sql files, use
> psql:
>
> psql mydb -f mysql.sql


--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Tena Sakai [ Mi, 19 Mai 2010 01:43 ] [ ID #2041674 ]
Datenbanken » gmane.comp.db.postgresql.admin » troubled by pg_dump and pg_restore

Vorheriges Thema: Restore database in postgres 8.4 linux
Nächstes Thema: advanced backup tool