Re: Strange bug - Mailing list pgsql-sql

From Leif B. Kristensen
Subject Re: Strange bug
Date
Msg-id 200511291701.26148.leif@solumslekt.org
Whole thread Raw
In response to Re: Strange bug  ("Leif B. Kristensen" <leif@solumslekt.org>)
Responses Re: Strange bug
List pgsql-sql
On Tuesday 29 November 2005 15:52, Leif B. Kristensen wrote:
>Uh-oh. That's my first 'gotcha' in PostgreSQL.
>
>I added the following constraints:

I probably should drop both the inheritance and the citation_id 
altogether, and operate with two separate tables:

CREATE TABLE relation_citations (   relation_fk INTEGER REFERENCES relations (relation_id),   source_fk INTEGER
REFERENCESsources (source_id),   CONSTRAINT PRIMARY KEY (relation_fk, source_fk)
 
);

CREATE TABLE event_citations (   event_fk INTEGER REFERENCES events (event_id),   source_fk INTEGER REFERENCES sources
(source_id),  CONSTRAINT PRIMARY KEY (event_fk, source_fk)
 
);

Is there an easy and non-disruptive way to do this?
-- 
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE


pgsql-sql by date:

Previous
From: "Leif B. Kristensen"
Date:
Subject: Re: Strange bug
Next
From: engineer@hlebprom.ru
Date:
Subject: 'AS' in 'DELETE/UPDATE'