Search Postgresql Archives

Re: Key not present in table, but it is.

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

 



Emanuel Calvo <postgres.arg@xxxxxxxxx> 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

-- 
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