Re: [postgis-users] check constraints violated - ¿how to fix this?
guido.lemoine at jrc.it
Tue Oct 25 06:44:00 PDT 2005
Your problem is that you define your geometry column with SRID = -1.
This becomes the enforce_srid_spos constraint on your table. Then, you
try to insert with SRID=4326, which fails the constaint check.
So, simple make it
'gs_inf', 'spos', 4326, 'POINT',
and your prob should be solved.
ricardd at mathstat.dal.ca wrote:
>Just a clarification about check constraints.
>I'm running postgis 1.0.3 with postgreSQL 8.0.3 on Linux. The
>spatial_ref_sys table was populated at installation with ESPG data using
>My data is from fisheries surveys and some records only have a starting
>position and no ending position. The spatial objects are defined as
> 'gs_inf', 'spos', -1, 'POINT',
> 'gs_inf', 'epos', -1, 'POINT',
>I thought that I could use something like this to input data with missing
>INSERT INTO gs_inf VALUES (GeomFromText('POINT(-66.7 44.8)',4326), NULL );
>However, I get the following error message:
>psql:gs_inf.sql.in:2: ERROR: new row for relation "gs_inf" violates check
>Any suggestions how I can solve this? Setting the srid to -1 solves the
>problem but I'm curious if there is another way.
>postgis-users mailing list
>postgis-users at postgis.refractions.net
More information about the postgis-users