Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Table has duplicate keys, what did I do



Somehow I have managed to have two tables with duplicate keys.
In both tables, the key is an integer, filled from a sequence.
There is only 1 duplicated entry in each table: in the first
table, there are two ID "1"s, and in the second table there are
two ID "123456"s (the second table entry is linked to the first
table's ID 1).

I noticed this because a pg_dump followed by a psql < dumpfile
will not reload.

I've figured out a fix: a script that cleans the dump file, removing
the two duplicate lines (leaving the original).

But, mostly, I'm wondering how I managed to get in this state,
if it was something I did, or perhaps caused by killing the
postmaster the wrong way (I don't think I ever did this, but
maybe), or a crash.

I did do a brief search, didn't find anything seemingly related to this.

Thanks,

j
-- 
John Gateley <gateley(at)jriver(dot)com>



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group