[postgis-users] setting SRID

Eric.Hillmuth at anr.state.vt.us Eric.Hillmuth at anr.state.vt.us
Fri Apr 30 09:46:14 PDT 2004


Hi all;

I'm using shp2pgsql and I've run into an issue that highlights my postgresql 
weakness. If I don't specify a SRID with Shp2pgsql I end up with this CHECK 
constraint on my new tables:
$1 CHECK (srid(the_geom) = -1) 

Now that I know the SRID I want for my table I used:
UPDATE trails
SET the_geom = setsrid(the_geom,32145);

Which produces the error:
new row for relation"trails" violates check constraint "$1"

Seems like I need to drop this constraint before I can set my SRID? If so how do I do 
that?

I'm running Postgresql 7.4.1, PostGIS 0.8, Geos 1.0 and Pro 4.4.7 on SuSE 8.2 
Linux.

-- 
Eric Hillmuth
GIS Systems Developer
Vermont Agency of Natural Resources
eric.hillmuth at anr.state.vt.us
802-241-3616 




More information about the postgis-users mailing list