Re: Key not present in table, but it is. - Mailing list pgsql-general

From Emanuel Calvo
Subject Re: Key not present in table, but it is.
Date
Msg-id CAGHEX6a8s1B5MWGpJj00zrcEqWXZspXpns9AK=5nEGcAXFNDnw@mail.gmail.com
Whole thread Raw
In response to Re: Key not present in table, but it is.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
2012/7/11 Tom Lane <tgl@sss.pgh.pa.us>:
> Emanuel Calvo <postgres.arg@gmail.com> writes:
>> Executed the following statement:
>> ...
>> ERROR:  insert or update on table "veraz" violates foreign key
>> constraint "veraz_dni_fkey"
>> DETAIL:  Key (dni)=(21530976) is not present in table "persona".
>
>>  But the record is present:
>
>> coches=# select * from dia4.persona where dni = 21530976;
>
> The record is present in a child table of dia4.persona, not dia4.persona
> itself (try "SELECT ... FROM ONLY dia4.persona" to confirm this).
> Foreign key constraints do not look into child tables; see the Caveats
> section at the bottom of
> http://www.postgresql.org/docs/9.1/static/ddl-inherit.html
>
>                         regards, tom lane

Got it. I thought that was happening something like this, didn't
remember about that limitation.

Thanks you once again the help.

--
--
Emanuel Calvo

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Key not present in table, but it is.
Next
From: "Gregorio, Albert"
Date:
Subject: Please Post