[Mapserver-users] How to delete a GIST Index in gc_ok

christian.schuster at rsag.ch christian.schuster at rsag.ch
Thu Jan 30 11:16:24 EST 2003


This is a multipart message in MIME format.
--=_alternative 00596480C1256CBE_=
Content-Type: text/plain; charset="US-ASCII"

Hi thanks so much. That just worked out!

Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11

http://www.rsag.ch
++41 31 348 05 30



"Mark Cave-Ayland" <mark.cave-ayland at webbased.co.uk> 
30.01.2003 17:14

To
<christian.schuster at rsag.ch>
cc

Subject
RE: [Mapserver-users] How to delete a GIST Index in gc_ok






Hi Christian,

The URL for the DropGeometryColumn command can be found at:

http://postgis.refractions.net/docs/c664.html

Sorry, I wasn't particularly clear about that one! What you need to do is 
recreate the table the same as it was when you deleted it before you can 
use DropGeometryColumn.

So for example create the 'geo' table again but without the geometry 
column

create table geo (ID int4, NAME varchar(20));

Then instead of doing AddGeometryColumn (which affects the 
geometry_columns table) you need to add the column name and type manually 
using this (where geom should be the name of your geometry column):

Alter table geo add column geom geometry;

Then use the DropGeometryColumn function to remove it like this:

Select DropGeometryColumn('myGISdb', 'geo', 'geom');

And then drop the table:

Drop table geo;


You should now be able to create a new table called 'geo' and add a new 
geometry column without any problems :)


Hope this helps,


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.
-----Original Message-----
From: christian.schuster at rsag.ch [mailto:christian.schuster at rsag.ch]
Sent: 30 January 2003 15:59
To: Mark Cave-Ayland
Cc: mapserver-users at lists.gis.umn.edu
Subject: RE: [Mapserver-users] How to delete a GIST Index in gc_ok


Hi Mark,

Unfortunately, I did not use the DropGeometryColumn function. I am also 
not aware of the syntax of this function because I could not find any 
information about this.
You wrote me to add the GeometryColumn again. This is just the part which 
is causing an error. So I am not able to add again a GeometryColumn wiht 
the previous table name.

Can you send me the synthay for the function DropGeometryColumn? Then I 
would try to delete it even if the table does not exist anmore.

Thanks

Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11

http://www.rsag.ch
++41 31 348 05 30

"Mark Cave-Ayland" <mark.cave-ayland at webbased.co.uk>
30.01.2003 16:22
To
<christian.schuster at rsag.ch>
cc

Subject
RE: [Mapserver-users] How to delete a GIST Index in gc_ok









Hi Christian,



Did you use the DropGeometryColumnto remove the old geometry column from 
the geo table? Otherwise you need to add the old geometry column back into 
your table, then use the function DropGeometryColumnto properly remove it. 
Once this is done, you should be able to carry on without any duplicate 
key problems.





Hope this helps,



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.

-----Original Message-----
From: christian.schuster at rsag.ch[mailto:christian.schuster at rsag.ch]
Sent:30 January 2003 13:56
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] How to delete a GIST Index in gc_ok




Hi list,

I had a table 'geo' with a geometry column of type point and also a GIST 
index. Then I deleted this table as well as the index belonging to it and 
create it again. So far okay. But as I wanted to add the geometry column I 
received the following error message. To work around this problem I 
renamed the table in to geo2 and then I could add the geometry column.

I am working on Win2000 with Cygwin, PostgreSQL-7.3.1-1 and PostGIS-0.7.3

Does anyone know how to delete the key in index gc_ok?

Thanks for your help.


myGISdb=# create table geo (ID int4, NAME varchar(20));
CREATE TABLE
myGISdb=# select addgeometrycolumn('myGISdb', 'geo', 'geom', -1, 'POINT', 
2);
ERROR:  Cannot insert a duplicate key into unique index gc_ok
WARNING:  Error occurred while executing PL/pgSQL function 
addgeometrycolumn
WARNING:  Error occurred while executing PL/pgSQL function 
addgeometrycolumn
WARNING:  line 39 at execute statement
WARNING:  line 39 at execute statement
ERROR:  Cannot insert a duplicate key into unique index gc_ok

Christian Schuster

Rudolf Schuster AG
Postfach 277
CH - 3000 Bern 11

http://www.rsag.ch
++41 31 348 05 30 

--=_alternative 00596480C1256CBE_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Hi thanks so much. That just worked
out!</font>
<br><font size=2 face="sans-serif"><br>
Christian Schuster<br>
<br>
Rudolf Schuster AG<br>
Postfach 277<br>
CH - 3000 Bern 11<br>
<br>
http://www.rsag.ch<br>
++41 31 348 05 30</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>&quot;Mark Cave-Ayland&quot;
&lt;mark.cave-ayland at webbased.co.uk&gt;</b> </font>
<p><font size=1 face="sans-serif">30.01.2003 17:14</font>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">&lt;christian.schuster at rsag.ch&gt;</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">RE: [Mapserver-users] How
to delete a GIST Index in gc_ok</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Hi Christian,<br>
</tt></font>
<br><font size=2><tt>The URL for the DropGeometryColumn command can be
found at:<br>
</tt></font>
<br><font size=2><tt>http://postgis.refractions.net/docs/c664.html<br>
</tt></font>
<br><font size=2><tt>Sorry, I wasn't particularly clear about that one!
What you need to do is recreate the table the same as it was when you deleted
it before you can use DropGeometryColumn.<br>
</tt></font>
<br><font size=2><tt>So for example create the 'geo' table again but without
the geometry column<br>
</tt></font>
<br><font size=2><tt>create table geo (ID int4, NAME varchar(20));<br>
</tt></font>
<br><font size=2><tt>Then instead of doing AddGeometryColumn (which affects
the geometry_columns table) you need to add the column name and type manually
using this (where geom should be the name of your geometry column):<br>
</tt></font>
<br><font size=2><tt>Alter table geo add column geom geometry;<br>
</tt></font>
<br><font size=2><tt>Then use the DropGeometryColumn function to remove
it like this:<br>
</tt></font>
<br><font size=2><tt>Select DropGeometryColumn('myGISdb', 'geo', 'geom');<br>
</tt></font>
<br><font size=2><tt>And then drop the table:<br>
</tt></font>
<br><font size=2><tt>Drop table geo;<br>
</tt></font>
<br>
<br><font size=2><tt>You should now be able to create a new table called
'geo' and add a new geometry column without any problems :)<br>
</tt></font>
<br>
<br><font size=2><tt>Hope this helps,<br>
</tt></font>
<br>
<br><font size=2><tt>Mark.<br>
</tt></font>
<br><font size=2><tt>---<br>
</tt></font>
<br><font size=2><tt>Mark Cave-Ayland<br>
Webbased Ltd.<br>
Tamar Science Park<br>
Derriford<br>
Plymouth<br>
PL6 8BX<br>
England<br>
</tt></font>
<br><font size=2><tt>Tel: +44 (0)1752 764445<br>
Fax: +44 (0)1752 764446<br>
</tt></font>
<br>
<br><font size=2><tt>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.<br>
-----Original Message-----<br>
From: christian.schuster at rsag.ch [mailto:christian.schuster at rsag.ch]<br>
Sent: 30 January 2003 15:59<br>
To: Mark Cave-Ayland<br>
Cc: mapserver-users at lists.gis.umn.edu<br>
Subject: RE: [Mapserver-users] How to delete a GIST Index in gc_ok<br>
</tt></font>
<br>
<br><font size=2><tt>Hi Mark,<br>
</tt></font>
<br><font size=2><tt>Unfortunately, I did not use the DropGeometryColumn
function. I am also not aware of the syntax of this function because I
could not find any information about this.<br>
You wrote me to add the GeometryColumn again. This is just the part which
is causing an error. So I am not able to add again a GeometryColumn wiht
the previous table name.<br>
</tt></font>
<br><font size=2><tt>Can you send me the synthay for the function DropGeometryColumn?
Then I would try to delete it even if the table does not exist anmore.<br>
</tt></font>
<br><font size=2><tt>Thanks<br>
</tt></font>
<br><font size=2><tt>Christian Schuster<br>
</tt></font>
<br><font size=2><tt>Rudolf Schuster AG<br>
Postfach 277<br>
CH - 3000 Bern 11<br>
</tt></font>
<br><font size=2><tt>http://www.rsag.ch<br>
++41 31 348 05 30<br>
</tt></font>
<br><font size=2><tt>&quot;Mark Cave-Ayland&quot; &lt;mark.cave-ayland at webbased.co.uk&gt;<br>
30.01.2003 16:22<br>
To<br>
&lt;christian.schuster at rsag.ch&gt;<br>
cc<br>
</tt></font>
<br><font size=2><tt>Subject<br>
RE: [Mapserver-users] How to delete a GIST Index in gc_ok<br>
</tt></font>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><font size=2><tt>Hi Christian,<br>
</tt></font>
<br>
<br>
<br><font size=2><tt>Did you use the DropGeometryColumnto remove the old
geometry column from the geo table? Otherwise you need to add the old geometry
column back into your table, then use the function DropGeometryColumnto
properly remove it. Once this is done, you should be able to carry on without
any duplicate key problems.<br>
</tt></font>
<br>
<br>
<br>
<br>
<br><font size=2><tt>Hope this helps,<br>
</tt></font>
<br>
<br>
<br><font size=2><tt>Mark.<br>
</tt></font>
<br>
<br>
<br><font size=2><tt>---<br>
</tt></font>
<br><font size=2><tt>Mark Cave-Ayland<br>
Webbased Ltd.<br>
Tamar Science Park<br>
Derriford<br>
Plymouth<br>
PL6 8BX<br>
England<br>
</tt></font>
<br><font size=2><tt>Tel: +44 (0)1752 764445<br>
Fax: +44 (0)1752 764446<br>
</tt></font>
<br>
<br><font size=2><tt>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.<br>
</tt></font>
<br><font size=2><tt>-----Original Message-----<br>
From: christian.schuster at rsag.ch[mailto:christian.schuster at rsag.ch]<br>
Sent:30 January 2003 13:56<br>
To: mapserver-users at lists.gis.umn.edu<br>
Subject: [Mapserver-users] How to delete a GIST Index in gc_ok<br>
</tt></font>
<br>
<br>
<br>
<br><font size=2><tt>Hi list,<br>
</tt></font>
<br><font size=2><tt>I had a table 'geo' with a geometry column of type
point and also a GIST index. Then I deleted this table as well as the index
belonging to it and create it again. So far okay. But as I wanted to add
the geometry column I received the following error message. To work around
this problem I renamed the table in to geo2 and then I could add the geometry
column.<br>
</tt></font>
<br><font size=2><tt>I am working on Win2000 with Cygwin, PostgreSQL-7.3.1-1
and PostGIS-0.7.3<br>
</tt></font>
<br><font size=2><tt>Does anyone know how to delete the key in index gc_ok?<br>
</tt></font>
<br><font size=2><tt>Thanks for your help.<br>
</tt></font>
<br>
<br><font size=2><tt>myGISdb=# create table geo (ID int4, NAME varchar(20));<br>
CREATE TABLE<br>
myGISdb=# select addgeometrycolumn('myGISdb', 'geo', 'geom', -1, 'POINT',
2);<br>
ERROR: &nbsp;Cannot insert a duplicate key into unique index gc_ok<br>
WARNING: &nbsp;Error occurred while executing PL/pgSQL function addgeometrycolumn<br>
WARNING: &nbsp;Error occurred while executing PL/pgSQL function addgeometrycolumn<br>
WARNING: &nbsp;line 39 at execute statement<br>
WARNING: &nbsp;line 39 at execute statement<br>
ERROR: &nbsp;Cannot insert a duplicate key into unique index gc_ok<br>
</tt></font>
<br><font size=2><tt>Christian Schuster<br>
</tt></font>
<br><font size=2><tt>Rudolf Schuster AG<br>
Postfach 277<br>
CH - 3000 Bern 11<br>
</tt></font>
<br><font size=2><tt>http://www.rsag.ch<br>
++41 31 348 05 30 </tt></font>
<br>
--=_alternative 00596480C1256CBE_=--



More information about the mapserver-users mailing list