From: | Charles Martin <martin_pgsql(at)yahoo(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | please help me recover from duplicate key in unique index |
Date: | 2000-01-04 23:28:41 |
Message-ID: | 20000104232841.13281.qmail@web3207.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Please help me recover our database from what I think
is a duplicate key in unique index problem.
We have a table of the following form:
create table foo (id serial primary key, x
integer)
in our code we had, outside of any BEGIN/COMMIT block:
insert into foo (x) values (...)
Without the transaction block, I believe we have had
duplicate keys inserted. I've fixed the bug in the
code, but now I need to fix the database!
When I try to vacuum, I get this:
> vacuum;
NOTICE: Rel sessions: TID 5/2: OID IS INVALID.
TUPGONE 1.
NOTICE: Rel sessions: TID 5/6: OID IS INVALID.
TUPGONE 1.
NOTICE: Rel sessions: TID 13/2: OID IS INVALID.
TUPGONE 1.
NOTICE: Rel sessions: TID 13/6: OID IS INVALID.
TUPGONE 1.
ERROR: Cannot insert a duplicate key into a unique
index
When I try to dump it out (to manually repair it), I
get this:
$ pg_dump gtmd000103 > gtmd.1
pqWait() -- connection not open
PQendcopy: resetting connection
SQL query to dump the contents of Table 'content' did
not execute correctly. After we read all the table
contents from the backend, PQendcopy() failed.
Explanation from backend: 'pqWait() -- connection not
open
'.
The query was: 'COPY "content" TO stdout;
'.
Can anybody help me? I am desperate. Thanks.
Charles
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://messenger.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Duncan Kinder | 2000-01-04 23:29:10 | Re: [GENERAL] Future of PostgreSQL |
Previous Message | Jim Mercer | 2000-01-04 22:08:22 | backend grows during cursor/select/fetch (memory leak?) |