[postgis-users] ERROR: new row for relation "x" violates check constraint "enforce_geotype_the_geom"

Frank Koormann frank.koormann at intevation.de
Thu Aug 9 03:04:02 PDT 2007


Hi again,

* Andreas Laggner <bloediandi at web.de> [070809 11:21]:
> i have to delete this constraint in EVERY table i want to write to! I 
> think that is not normal?! 

Partly - yes:

- AddGeometryColumn creates a contraint according to the geometry type
  specified to be compliant with OGC.
- As a consequence you should first check the potential outcome of your 
  geomunion operation before creating the geomcolumn, you might run 
  something like:

  select distinct(geometrytype(geomunion(t1.the_geom, t2.the_geom)))
    from gf_veg1 t1, gf_veg2 t2
    where t1.the_geom && t2.the_geom;

Regards,

        Frank

-- 
Frank Koormann  |  ++49-541-335 08 30  |  http://www.intevation.de/
Intevation GmbH, Georgstr. 4, 49074 Osnabrück, DE | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner



More information about the postgis-users mailing list