"Mason Hale" <masonhale@xxxxxxxxx> writes: > After running pg_dump to backup my database, and then running pg_restore to > load the db (on a different server), > I run into a problem with creating a sequence. Hmm ... which sequence is entry.id actually referring to on the source database? I suspect that it is linked to some differently-named sequence like "entry_id_seq1" and the source's "entry_id_seq" is not in truth doing anything (and, in particular, hasn't ever been advanced, so when the restore script sets its value to 1 it's clobbering the other sequence). The methodology that pre-8.2 pg_dump uses for serial columns is vulnerable to quite a number of problems if serial sequences don't have the expected names, and this seems to be another one. 8.2 would be able to handle the case, but in 8.1 the best advice is to drop the unused sequence to avoid the name collision when SERIAL picks plain "entry_id_seq" as the serial sequence's name upon reload. regards, tom lane