Re: Problem with REFERENCES on INHERITS - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with REFERENCES on INHERITS
Date
Msg-id 15673.1422889861@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problem with REFERENCES on INHERITS  (William Gordon Rutherdale <will.rutherdale@utoronto.ca>)
Responses Re: Problem with REFERENCES on INHERITS  (William Gordon Rutherdale <will.rutherdale@utoronto.ca>)
List pgsql-general
William Gordon Rutherdale <will.rutherdale@utoronto.ca> writes:
> So this statement:
> INSERT INTO banana_stash(primate_id, qty) VALUES (1, 17);
> Resulted in this error:
> ERROR:  insert or update on table "banana_stash" violates foreign key
> constraint "banana_stash_primate_id_fkey"
> DETAIL:  Key (primate_id)=(1) is not present in table "primate".

> How am I to interpret this?  A select * from primate shows that a row
> with primate.id exists, yet the error message indicates that it doesn't.

If you did "select * from only primate" you would see that there is no
such row in the parent table, which is what the foreign key is being
enforced against.

            regards, tom lane


pgsql-general by date:

Previous
From: theftp
Date:
Subject: Re: BDR Error restarted
Next
From: Merlin Moncure
Date:
Subject: Re: cannot start 9.3 after system crash