William Gordon Rutherdale <will(dot)rutherdale(at)utoronto(dot)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