Search Postgresql Archives

Re: Problem with REFERENCES on INHERITS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Gordon Rutherdale <will.rutherdale@xxxxxxxxxxx> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux