[postgis-users] Check-Constraint »enforce_geotype_poly« violated

Jan Saalbach fire at dubmosphere.de
Tue Nov 2 07:30:49 PDT 2010

Dear All,
when trying to insert a polygon into a table from a plperl script by 
this command:

my $new_poly = spi_exec_query("INSERT INTO polys1(id,poly) 
VALUES($new_id, ST_MakeEnvelope($xmin, $ymin , $xmax, $ymax, 31467));");

I get a

"new row for relation »polys1« violates Check-Constraint 

What I think it means is that only a POLYGON can be inserted. Now, 
previously (not from a plperl script) the same INSERT command with 
MakeEnvelope worked just fine on a table with the exact same structure 
and properties.

The Column was created using

SELECT AddGeometryColumn('polys1','poly',31467,'POLYGON', 2);

How can I get this INSERT command to work? Any suggestions?


More information about the postgis-users mailing list