X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BFFDD9DCB88 for ; Tue, 29 Nov 2005 10:31:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31387-03 for ; Tue, 29 Nov 2005 10:31:35 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail48.e.nsc.no (mail48.e.nsc.no [193.213.115.48]) by postgresql.org (Postfix) with ESMTP id EF8119DCA9F for ; Tue, 29 Nov 2005 10:31:28 -0400 (AST) Received: from [192.168.0.57] (062016183238.customer.alfanett.no [62.16.183.238]) (authenticated bits=0) by mail48.nsc.no (8.13.5/8.13.5) with ESMTP id jATEVUam021886 for ; Tue, 29 Nov 2005 15:31:31 +0100 (CET) From: "Leif B. Kristensen" To: pgsql-sql@postgresql.org Subject: Strange bug Date: Tue, 29 Nov 2005 15:31:30 +0100 User-Agent: KMail/1.8.1 X-Face: %iea8o"[SI'kMDS.`hz7lU=?\^lC9J-]CVjo; f{4-C:$?uVUEjyN~uYFn%*aH_c3d09U>=?utf-8?q?x=0A=09TXtaoj=7EMV=2E8PgG7hik9=3BcCT2N6+u?=@Y{wH\p3*_f~FH9k,Wi74e[_l%.7b^'zJ)8S'^G<(=?utf-8?q?=3D=0A=09zw8=5CPMC3=27=7BKl9=2EzL*ks!b6wA?=,c~'F`k&Vq|ELDGa|4 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/269 X-Sequence-Number: 23520 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