Re: [postgis-users] restricción check

Nicolas Ribot nicky666 at
Thu Jan 15 01:17:59 PST 2009

> hi, when i try to insert record from parcelas table into prueba table, the
> are is error.
> ERROR: el nuevo registro para la relación «prueba» viola la restricción
> check «enforce_srid_the_geom»
> Estado SQL:23514
> this is the syntaxis
> insert into prueba (SELECT gid,p.the_geom as the_geom from parcelas p where
> gid < 50)

you are playing with mixed SRID's geometries and the check constraint
on the prueba table enforces that srid's must be consistent.
Either enclose a setsrid(geom, srid) around the p.the_geom or drop the
check constraint (not the best idea).
If prueba and parcelas have distinct SRID's, both different from -1,
then you should transform geometries to keep consistent objets.


More information about the postgis-users mailing list