pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedTrouble restoring 7.2.1 database into 7.4.2 database
2+ messages / 2 participants
[nested] [flat]
* Trouble restoring 7.2.1 database into 7.4.2 database
@ 2004-04-09 07:26 Chris White (cjwhite) <cjwhite@cisco.com>
0 siblings, 1 reply; 2+ messages in thread
From: Chris White (cjwhite) @ 2004-04-09 07:26 UTC (permalink / raw)
To: pgsql-admin
I have table defined as follows:
create table vm_emailjob
(
JobId serial not null,
MessageId varchar(128) not null,
Recipients bytea not null,
SendTime bigint not null,
QueuedTime bigint not null,
RetryCount integer not null,
primary key (JobId)
);
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
and the restore fails. If I edit the pg_backup_db.c to display what's
statements are being executed I see the following:
sending: 'DROP TABLE "vm_emailjob";'
sending: 'DROP SEQUENCE "vm_emailjob_jobid_seq";'
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.
If I do the restore on a 7.2.1 database I have no problem.
How can I get around this?
Chris White
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Trouble restoring 7.2.1 database into 7.4.2 database
@ 2004-04-09 12:51 Tom Lane <tgl@sss.pgh.pa.us>
parent: Chris White (cjwhite) <cjwhite@cisco.com>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2004-04-09 12:51 UTC (permalink / raw)
To: cjwhite@cisco.com; +Cc: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-04-09 12:51 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-09 07:26 Trouble restoring 7.2.1 database into 7.4.2 database Chris White (cjwhite) <cjwhite@cisco.com>
2004-04-09 12:51 ` Tom Lane <tgl@sss.pgh.pa.us>
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