pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: BARTKO, Zoltán <bartko.zoltan@pobox.sk>
Cc: pgsql-sql@postgresql.org
Subject: Re: foreign key problems
Date: Tue, 4 Jan 2005 06:56:22 -0800 (PST)
Message-ID: <20050104064025.L6897@megazone.bigpanda.com> (raw)
In-Reply-To: <200501041215.j04CFe7s017600@www7.pobox.sk>
References: <200501041215.j04CFe7s017600@www7.pobox.sk>


On Tue, 4 Jan 2005, [iso-8859-2] BARTKO, Zoltán wrote:

> if I create the tables that are in the attached file, I can't insert
> rows into the AAttachment table, even though the rows in DObject with
> the given primary key exist (PgSQL 8.0 rc1 complains about
> (ownerid)=(insert the number here) not available in DObject. The same
> happens with attribute bodyid).

It looks like the set of table definitions you gave in the attached file
do not actually work as given, and there's no example data. Running on
8.0 beta3 I was able to insert data that allowed me to place a row into
AAttachment (and in fact I actually can insert some data that probably
should not be allowed). I'm not sure if that's based on my basically null
definition of DRecord or not however.

In general, however, foreign keys and inheritance don't mix (neither do
primary keys or unique constraints). In general, they'll only currently
work for the table they're in specifically and only for the table
mentioned specifically. So, for example, the references constraints in
AObjAssociation are not inherited by AAttachment. Inheritance really needs
someone to champion getting all of these deficiencies fixed.



view thread (5+ messages)  latest in thread

Message-ID: <20050104064025.L6897@megazone.bigpanda.com>
Permalink:  ../20050104064025.L6897@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20050104064025.L6897@megazone.bigpanda.com

 · 

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: sszabo@megazone.bigpanda.com, bartko.zoltan@pobox.sk
  Subject: Re: foreign key problems
  In-Reply-To: <20050104064025.L6897@megazone.bigpanda.com>

* 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