From: | Steve Lane <slane(at)moyergroup(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Backups and restores. |
Date: | 2003-06-08 20:40:19 |
Message-ID: | BB090963.30DD9%slane@moyergroup.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 6/6/03 7:09 PM, "Brian Avis" <brian(dot)avis(at)searhc(dot)org> wrote:
>
> I am upgrading my workstation to 7.3.3. I have some database backups
> that were created with this command.
>
> /usr/local/pgsql/bin/pg_dump $db | gzip > /usr/local/pgsql/backups/$filename
>
> Which generates this sort of file.
>
> pgdump_2003-6-5-csp.gz
>
> Formatted like so.
>
> \connect - postgres
> CREATE SEQUENCE "time_periods_id_seq" start 3 increment 1 maxvalue
> 2147483647 minvalue 1 cache 1 ;
> SELECT nextval ('"time_periods_id_seq"');
> CREATE SEQUENCE "length_of_time_id_seq" start 5 increment 1 maxvalue
> 2147483647 minvalue 1 cache 1 ;
> SELECT nextval ('"length_of_time_id_seq"');
> CREATE SEQUENCE "depts_id_seq" start 61 increment 1 maxvalue 2147483647
> minvalue 1 cache 1 ;
> SELECT nextval ('"depts_id_seq"');
> CREATE SEQUENCE "divisions_id_seq" start 4 increment 1 maxvalue
> 2147483647 minvalue 1 cache 1 ;
>
>
> And so on and so forth.
>
> When I try to use pg_restore from 7.3.3 to restore that file with this
> command.
> ./bin/pg_restore -d csp pgdump_2003-6-5-csp
> Or even this one.
> ./bin/pg_restore -d csp pgdump_2003-6-5-csp.gz
>
> I get this error.
>
> pg_restore: [archiver] input file does not appear to be a valid archive
>
> So what sort of terribly obvious thing am I doing wrong?
>
> I tried to do a search for this in the mailing list archives but the
> database is apparently temporarily down. :) Go figure. Just when I
> need it.
>
> Thanks for the help all.
>
>
Hi Brian:
I'm not sure that pg_restore works with the default output from pg_dump.
Pg_dump has several additional formats, and these I believe can be used as
inputs to pg_dump.
Regardless of whether I'm correct on that point, you should be able to load
these files from within psql by using the \i command. If the files don't
contain the necessary database creation commands, you may need to create the
databases first, then connect to them, before executing the file.
-- sgl
=======================================================
Steve Lane
Vice President
The Moyer Group
14 North Peoria St Suite 2H
Chicago, IL 60607
Voice: (312) 433-2421 Email: slane(at)moyergroup(dot)com
Fax: (312) 850-3930 Web: http://www.moyergroup.com
=======================================================
From | Date | Subject | |
---|---|---|---|
Next Message | Avi Schwartz | 2003-06-08 21:27:59 | Re: Temporary tables inside functions problem |
Previous Message | Arjen van der Meijden | 2003-06-08 19:55:19 | Re: Linux 2.6 kernel, |