pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
troubled by pg_dump and pg_restore
5+ messages / 5 participants
[nested] [flat]

* troubled by pg_dump and pg_restore
@ 2010-05-18 23:14  Tena Sakai <sakaitena@yahoo.com>
  0 siblings, 3 replies; 5+ messages in thread

From: Tena Sakai @ 2010-05-18 23:14 UTC (permalink / raw)
  To: pgsql-admin

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=postgres
  PGDATABASE=canon
  PGHOST=localhost
  PGDATA=/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 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?

Thank you.

Regards,

Tena sakai

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: troubled by pg_dump and pg_restore
@ 2010-05-18 23:20  Rosser Schwarz <rosser.schwarz@gmail.com>
  parent: Tena Sakai <sakaitena@yahoo.com>
  2 siblings, 0 replies; 5+ messages in thread

From: Rosser Schwarz @ 2010-05-18 23:20 UTC (permalink / raw)
  To: Tena Sakai <sakaitena@yahoo.com>; +Cc: pgsql-admin

On Tue, May 18, 2010 at 5:14 PM, Tena Sakai <sakaitena@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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: troubled by pg_dump and pg_restore
@ 2010-05-18 23:24  Samuel Stearns <SStearns@internode.com.au>
  parent: Tena Sakai <sakaitena@yahoo.com>
  2 siblings, 0 replies; 5+ messages in thread

From: Samuel Stearns @ 2010-05-18 23:24 UTC (permalink / raw)
  To: Tena Sakai <sakaitena@yahoo.com>; pgsql-admin

Try this:

pg_dump -n tsakai canon | psql musket

Sam

________________________________
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Tena Sakai
Sent: Wednesday, 19 May 2010 8:45 AM
To: pgsql-admin@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=postgres
  PGDATABASE=canon
  PGHOST=localhost
  PGDATA=/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 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?

Thank you.

Regards,

Tena sakai

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: troubled by pg_dump and pg_restore
@ 2010-05-18 23:26  Scott Marlowe <scott.marlowe@gmail.com>
  parent: Tena Sakai <sakaitena@yahoo.com>
  2 siblings, 1 reply; 5+ messages in thread

From: Scott Marlowe @ 2010-05-18 23:26 UTC (permalink / raw)
  To: Tena Sakai <sakaitena@yahoo.com>; +Cc: pgsql-admin

(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@yahoo.com> wrote:
>
> 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=postgres
>   PGDATABASE=canon
>   PGHOST=localhost
>   PGDATA=/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 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?

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

psql mydb -f mysql.sql



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: troubled by pg_dump and pg_restore
@ 2010-05-18 23:43  Tena Sakai <tsakai@gallo.ucsf.edu>
  parent: Scott Marlowe <scott.marlowe@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Tena Sakai @ 2010-05-18 23:43 UTC (permalink / raw)
  To: Scott Marlowe <scott.marlowe@gmail.com>; Tena Sakai <SakaiTena@yahoo.com>; +Cc: pgsql-admin

Many thanks, Rosser, Sam, and Scott.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu


On 5/18/10 4:26 PM, "Scott Marlowe" <scott.marlowe@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@yahoo.com> wrote:
>> 
>> 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=postgres
>>   PGDATABASE=canon
>>   PGHOST=localhost
>>   PGDATA=/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 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?
> 
> pg_restore expects custom format  from pg_dump.  For plain sql files, use
> psql:
> 
> psql mydb -f mysql.sql




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2010-05-18 23:43 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18 23:14 troubled by pg_dump and pg_restore Tena Sakai <sakaitena@yahoo.com>
2010-05-18 23:20 ` Rosser Schwarz <rosser.schwarz@gmail.com>
2010-05-18 23:24 ` Samuel Stearns <SStearns@internode.com.au>
2010-05-18 23:26 ` Scott Marlowe <scott.marlowe@gmail.com>
2010-05-18 23:43   ` Tena Sakai <tsakai@gallo.ucsf.edu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox