Обсуждение: Errors with pg_dump
I would like to move some data from an older installation of PostgreSQL to a newer. When doing "pg_dump persondb > db.out" I get the following error message: "dumpSequence(person_sek): 0 (!=1) tuples returned by SELECT" The "person_sek" is a sequence in the database. The version of PostgreSQL in question is 6.3.2, running on RedHat Linux 5.1/5.2. The actual database (persondb) seems to be running fine in all other respects. It can be queried with psql, and is used as the backend for a set of web pages. Help, anybody? Asbjørn Sæbø
>
> I would like to move some data from an older installation of PostgreSQL to
> a newer. When doing
> "pg_dump persondb > db.out" I get the following error message:
>
> "dumpSequence(person_sek): 0 (!=1) tuples returned by SELECT"
>
> The "person_sek" is a sequence in the database.
>
I believe sequences are implemented as a separate with one row that contains
the sequence parameters and state. It looks like somehow that one row has
been deleted and pg_dump expects it to be there.
Is this sequence being used by your program and is it functioning correctly?
Can you do a select nextval('person_sek')?
If you need the sequence and you know what its current value and other
parameters should be then I suggest droping and recreating the sequence.
asbjs@stud.ntnu.no writes:
> I would like to move some data from an older installation of PostgreSQL to
> a newer. When doing
> "pg_dump persondb > db.out" I get the following error message:
> "dumpSequence(person_sek): 0 (!=1) tuples returned by SELECT"
> The "person_sek" is a sequence in the database.
> The version of PostgreSQL in question is 6.3.2,
Hmm. Does the sequence still work (can you do SELECT nextval('person_sek'))?
Not sure why the dump attempt would be failing, and 6.3.2 is far enough
back that digging for bugs in it isn't very appealing. I'd suggest just
looking for a work-around instead of a real solution.
You could probably just drop and recreate the sequence before running
pg_dump, being careful to set the new sequence's initial value to
whatever its current value is.
regards, tom lane