Re: Dump / restore question - Mailing list pgsql-general

From Tom Lane
Subject Re: Dump / restore question
Date
Msg-id 28092.1041317045@sss.pgh.pa.us
Whole thread Raw
In response to Dump / restore question  (Garo Hussenjian <garo@xapnet.com>)
Responses Re: Dump / restore question  (Garo Hussenjian <garo@xapnet.com>)
List pgsql-general
Garo Hussenjian <garo@xapnet.com> writes:
> I tried "pg_restore --rearrange dump_file" but I get the error:
> pg_restore: [archiver] input file does not appear to be a valid archive
> Is this because I did not dump with the -F (format) option?

If you used no -F option, pg_dump defaults to a plain SQL-script dump,
which you must needs feed to psql to restore.  pg_restore only works
with -Ft or -Fc output of pg_dump.

If you don't want to restore indexes, my advice would be to run pg_dump
twice with -s (schema only) and -a (data only) options.  Then manually
edit the -s output to remove index definitions, along with anything else
you don't need.  Then restore both parts via psql.  This is low-tech but
gives you pretty complete control over what happens.

            regards, tom lane

pgsql-general by date:

Previous
From: Garo Hussenjian
Date:
Subject: Dump / restore question
Next
From: Garo Hussenjian
Date:
Subject: Re: Dump / restore question