Re: Bug #518: SERIAL type value not seen in FOREIGN KEY

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: <edward(dot)grabczewski(at)btinternet(dot)com>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Bug #518: SERIAL type value not seen in FOREIGN KEY
Date: 2001-11-21 20:50:51
Message-ID: 20011121124806.Q67806-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On Wed, 21 Nov 2001 pgsql-bugs(at)postgresql(dot)org wrote:

> Edward Grabczewski (edward(dot)grabczewski(at)btinternet(dot)com) reports a bug with a severity of 1
> The lower the number the more severe it is.
>
> Short Description
> SERIAL type value not seen in FOREIGN KEY
>
> Long Description
> I have defined a table called arch_object which contains a SERIAL type.
> I have defined another table called mm_object which REFERENCES this
> SERIAL type column.
> I insert a value into table arch_object. This generates the next
> value, which is seen using a SELECT statement.
> I try to insert a value into mm_object based on this new value in
> table arch_object and the INSERT is rejected.
> I cannot see why as this value plainly exists in the arch_object table
> and should be picked up.

Foreign keys and inheritance do not currently play terribly nicely
together. I think the problem is that you're trying to reference
the row in deposit through arch_object which doesn't work because
the foreign keys are currently explicitly referring to only that
table (do a select * from only arch_object;)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2001-11-22 03:10:02 Re: Bug #513: union all changes char(3) column definition
Previous Message pgsql-bugs 2001-11-21 20:27:21 Bug #518: SERIAL type value not seen in FOREIGN KEY