[postgis] Unable to drop contraint

Dave Blasby dblasby at refractions.net
Mon Feb 25 17:04:45 PST 2002


John Reid wrote:
> 
> Another alternative is to directly manipulate the postgres system
> catalogues (danger Will Robinson!!!!).  You will need at least usesuper

Pull Up!!  Pull Up!!

Its usually a really bad thing to directly modify the system catalogs.  

You should really just DropGeometryColumn(), then drop the table and
start from scratch.

Alternatively, here's another method that should work for you:

1. Make a copy of your table (this will have no contraints on it):
	create table tmp_table as select * from <table>;
2. DropGeometryColumn() on your old table to de-register the geometry in
the geometry_columns table
3. drop the old table
4. create the table again
5. AddGeometryColumn() to create & register the geometry column.  Make
sure you set the parameters correctly.
6. If you're changing SRIDs you'll have to:
	update table tmp_table set <geometry column> = setSRID(<geometry
column>,<srid>)
7. use "select into..." to put the rows in tmp_table into the new table

dave

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Tiny Wireless Camera under $80!
Order Now! FREE VCR Commander!
Click Here - Only 1 Day Left!
http://us.click.yahoo.com/nuyOHD/7.PDAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list