From: | "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Strange bug |
Date: | 2005-11-29 14:31:30 |
Message-ID: | 200511291531.30441.leif@solumslekt.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
I just noticed that I accidentally got a duplicate id. My
definitions are here:
CREATE TABLE citations (
citation_id INTEGER PRIMARY KEY,
source_fk INTEGER REFERENCES sources (source_id)
);
CREATE TABLE relation_citations (
relation_fk INTEGER REFERENCES relations (relation_id)
) INHERITS (citations);
ALTER TABLE relation_citations
ADD CONSTRAINT source_relation_citation UNIQUE
(source_fk, relation_fk);
CREATE INDEX cit_relation_key ON relation_citations (relation_fk);
CREATE TABLE event_citations (
event_fk INTEGER REFERENCES events (event_id)
) INHERITS (citations);
ALTER TABLE event_citations
ADD CONSTRAINT source_event_citation UNIQUE
(source_fk, event_fk);
CREATE INDEX cit_event_key ON event_citations (event_fk);
And here is the accident:
pgslekt=> insert into relation_citations values (64062,4578,20017);
INSERT 1478990 1
pgslekt=> insert into relation_citations values (64062,4578,20018);
INSERT 1478991 1
I got an error when I transferred the data to my Web database running
MySQL:
ERROR 1062 at line 19839 in file: 'ss_relation_citations.sql': Duplicate
entry '64062' for key 1
How can this happen?
--
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2005-11-29 14:37:42 | Re: Strange bug |
Previous Message | frank church | 2005-11-29 10:43:13 | Re: How to change database owner in PostgreSQL 7.4? |