From: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Strange bug |
Date: | 2005-11-29 14:43:50 |
Message-ID: | 20051129144350.GO31026@webserv.wug-glas.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
am 29.11.2005, um 15:31:30 +0100 mailte Leif B. Kristensen folgendes:
> 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);
You are using inheritation in PostgreSQL.
>
> ALTER TABLE relation_citations
> ADD CONSTRAINT source_relation_citation UNIQUE
> (source_fk, relation_fk);
> CREATE INDEX cit_relation_key ON relation_citations (relation_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
Right, the uniq contraints are on (source_fk, relation_fk).
No problem.
>
> I got an error when I transferred the data to my Web database running
> MySQL:
MySQL is a other RDBMS. You can't expect that all features from
PostgreSQL are working with MySQL.
>
> ERROR 1062 at line 19839 in file: 'ss_relation_citations.sql': Duplicate
> entry '64062' for key 1
My guess: MySQL can't handle inheritance.
HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===
From | Date | Subject | |
---|---|---|---|
Next Message | Leif B. Kristensen | 2005-11-29 14:52:52 | Re: Strange bug |
Previous Message | Tom Lane | 2005-11-29 14:37:42 | Re: Strange bug |