[postgis-users] Check constraint violation using buffer()

Gary Sherman sherman at mrcc.com
Fri Jan 23 11:07:17 PST 2004


I'm attempting to buffer a LINESTRING layer and insert the resulting
rows into a new table. The source layer has ~5,000 records. This process
(buffer and insert) worked on a small layer with only 27 features.
Details below. Any suggestions?



Source table:
gis_data=# \d majrivers
            Table "public.majrivers"
   Column   |         Type          | Modifiers
------------+-----------------------+-----------
 gid        | integer               |
 length     | double precision      |
 decription | character varying(29) |
 the_geom   | geometry              |
Check constraints:
    "$1" CHECK (srid(the_geom) = -1)
    "$2" CHECK (geometrytype(the_geom) = 'LINESTRING'::text OR the_geom
IS NULL) 

Target table:
gis_data=# \d majrivers_buffercrash
Table "public.majrivers_buffercrash"
  Column  |   Type   | Modifiers
----------+----------+-----------
 gid      | integer  |
 the_geom | geometry |
Check constraints:
    "$1" CHECK (srid(the_geom) = -1)
    "$2" CHECK (geometrytype(the_geom) = 'POLYGON'::text OR the_geom IS
NULL)
 
gis_data=# insert into majrivers_buffercrash select gid,
buffer(the_geom,1000.0) from public.majrivers
gis_data-# ;
ERROR:  new row for relation "majrivers_buffercrash" violates check
constraint "$2"

-gary
-- 
Gary Sherman <sherman at mrcc.com>
QGIS: http://qgis.org




More information about the postgis-users mailing list