[Mapserver-users] How to delete a GIST Index in gc_ok
Mark Cave-Ayland
mark.cave-ayland@webbased.co.uk
Thu, 30 Jan 2003 16:32:42 -0000
-----Original Message-----
> From: Eric L. Blevins [mailto:eblevins@insight.rr.com]
> Sent: 30 January 2003 16:21
> To: Mark Cave-Ayland; christian.schuster@rsag.ch
> Cc: mapserver-users@lists.gis.umn.edu
> Subject: Re: [Mapserver-users] How to delete a GIST Index in gc_ok
>
> Here you will find the PostGIS function information >http://postgis.refractions.net/docs/
>
> DropGeometryColumn(varchar, varchar, varchar)
> Syntax: DropGeometryColumn(<db_name>, <table_name>, <column_name>). Remove a geometry column from a spatial table.
> Unfourtunatly I've tried to drop a geometry column after droping the table and it > does not work.
> As far as I know once you drop the table you can not add a geometry or drop the
> geometry with the same name, unless you droped the geometry before droping the
> table.
> In the past what I have done is drop the database and recreate all the tables when I
> forgot to drop the geometry before droping the table.
Hi Eric,
That's not entirely true, I've just noticed my reply didn't go onto the list so I'll make sure it gets there this time.
If I have a table like:
Create table t1 (
Id int,
Name varchar
)
Select AddGeometryColumn('mydb', 't1', 'geom', -1, 'POINT', 2);
And then do:
Drop table t1;
...then it is still possible to recover from this! In this case, the correct thing to do would be:
Create table t1 (
Id int,
Name varchar
)
...to create the table again. Then add a geometry column of type 'geometry' of the same name to the table manually:
Alter table t1 add column geom geometry;
Now you can do:
Select DropGeometryColumn('mydb', 't1', 'geom');
.... and then everything works as it should :)
Cheers,
Mark.
---
Mark Cave-Ayland
Webbased Ltd.
Tamar Science Park
Derriford
Plymouth
PL6 8BX
England
Tel: +44 (0)1752 764445
Fax: +44 (0)1752 764446
This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person.
_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users