Re: Trouble restoring 7.2.1 database into 7.4.2 database - Mailing list pgsql-admin

From Tom Lane
Subject Re: Trouble restoring 7.2.1 database into 7.4.2 database
Date
Msg-id 24720.1081515066@sss.pgh.pa.us
Whole thread Raw
In response to Trouble restoring 7.2.1 database into 7.4.2 database  ("Chris White (cjwhite)" <cjwhite@cisco.com>)
List pgsql-admin
"Chris White (cjwhite)" <cjwhite@cisco.com> writes:
> When I restore a backup into a 7.4.2 database from a backup made on
> 7.2.1 database, using the clean option, I get the following error.
>
> pg_restore: [archiver (db)] could not execute query: ERROR:  sequence
> "vm_emailjob_jobid_seq" does not exist
>
> Looks like the Drop table is also deleting the sequence.

Yup, serial columns work that way since 7.3 or so.  Unfortunately 7.2's
pg_dump does not know that.

> How can I get around this?

Don't use --clean, or use 7.4's pg_dump to dump from the older server.

            regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: parameter to control cycle detection
Next
From: Ben Kim
Date:
Subject: sequence value of the record just inserted.