[postgis-users] setting SRID

David Blasby dblasby at refractions.net
Fri Apr 30 09:49:13 PDT 2004


Eric.Hillmuth at anr.state.vt.us wrote:

> 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.
> 

ALTER TABLE <table> DROP CONSTRAINT "$1";





More information about the postgis-users mailing list