pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-sql@postgresql.org
Subject: Re: Strange bug
Date: Tue, 29 Nov 2005 15:43:50 +0100
Message-ID: <20051129144350.GO31026@webserv.wug-glas.de> (raw)
In-Reply-To: <200511291531.30441.leif@solumslekt.org>
References: <200511291531.30441.leif@solumslekt.org>

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    === 



view thread (7+ messages)  latest in thread

Message-ID: <20051129144350.GO31026@webserv.wug-glas.de>
Permalink:  ../20051129144350.GO31026@webserv.wug-glas.de/
Also on:    postgresql.org/message-id/20051129144350.GO31026@webserv.wug-glas.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: andreas.kretschmer@schollglas.com
  Subject: Re: Strange bug
  In-Reply-To: <20051129144350.GO31026@webserv.wug-glas.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox