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

Eric L. Blevins eblevins at insight.rr.com
Thu Jan 30 08:21:01 PST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_004E_01C2C851.AB6D7A20
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Here you will find the PostGIS function information =
http://postgis.refractions.net/docs/

DropGeometryColumn(varchar, varchar, varchar)=20
Syntax: DropGeometryColumn(<db_name>, <table_name>, <column_name>). =
Remove a geometry column from a spatial table.=20

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.

That will work but is a pain.


--------------------------------------------------------
Eric L. Blevins    www.WiFiMaps.com
--------------------------------------------------------
  ----- Original Message -----=20
  From: christian.schuster at rsag.ch=20
  To: Mark Cave-Ayland=20
  Cc: mapserver-users at lists.gis.umn.edu=20
  Sent: Thursday, January 30, 2003 10:59 AM
  Subject: RE: [Mapserver-users] How to delete a GIST Index in gc_ok



  Hi Mark,=20

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

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

  Thanks=20

  Christian Schuster

  Rudolf Schuster AG
  Postfach 277
  CH - 3000 Bern 11

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


        "Mark Cave-Ayland" <mark.cave-ayland at webbased.co.uk>=20
        30.01.2003 16:22=20
       To <christian.schuster at rsag.ch> =20
              cc =20
              Subject RE: [Mapserver-users] How to delete a GIST Index =
in gc_ok=20

             =20

      =20





  Hi Christian,=20

   =20

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

   =20

   =20

  Hope this helps,=20

   =20

  Mark.=20

   =20

  ---=20

  Mark Cave-Ayland=20
  Webbased Ltd.=20
  Tamar Science Park=20
  Derriford=20
  Plymouth=20
  PL6 8BX=20
  England=20

  Tel: +44 (0)1752 764445=20
  Fax: +44 (0)1752 764446=20


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

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

   =20


  Hi list,=20

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

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

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

  Thanks for your help.=20


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

  Christian Schuster=20

  Rudolf Schuster AG=20
  Postfach 277=20
  CH - 3000 Bern 11=20

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


------=_NextPart_000_004E_01C2C851.AB6D7A20
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2722.900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Here you will find the PostGIS function =
information=20
<A=20
href=3D"http://postgis.refractions.net/docs/">http://postgis.refractions.=
net/docs/</A></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DT> 
<DT>DropGeometryColumn(varchar, varchar, varchar)=20
<DD>
<P>Syntax: DropGeometryColumn(<db_name>, <table_name>,=20
<column_name>). Remove a geometry column from a spatial table.=20
</P></DD></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Unfourtunatly I've tried to drop a =
geometry column=20
after droping the table and it does not work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>As far as I know once you drop the =
table you can=20
not add a geometry or drop the geometry with the same name, unless you =
droped=20
the geometry before droping the table.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>In the past what I have done is drop =
the database=20
and recreate all the tables when I forgot to drop the geometry before =
droping=20
the table.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>That will work but is a =
pain.</FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>--------------------------------------------------------<BR>Eric=
 L.=20
Blevins    <A=20
href=3D"http://www.WiFiMaps.com">www.WiFiMaps.com</A><BR>----------------=
----------------------------------------</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dchristian.schuster at rsag.ch=20
  =
href=3D"mailto:christian.schuster at rsag.ch">christian.schuster at rsag.ch</A>=
 </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  title=3Dmark.cave-ayland at webbased.co.uk=20
  href=3D"mailto:mark.cave-ayland at webbased.co.uk">Mark Cave-Ayland</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Cc:</B> <A=20
  title=3Dmapserver-users at lists.gis.umn.edu=20
  =
href=3D"mailto:mapserver-users at lists.gis.umn.edu">mapserver-users at lists.g=
is.umn.edu</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, January 30, =
2003 10:59=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> RE: [Mapserver-users] =
How to=20
  delete a GIST Index in gc_ok</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT><BR></DIV><BR><FONT =
face=3Dsans-serif=20
  size=3D2>Hi Mark,</FONT> <BR><BR><FONT face=3Dsans-serif =
size=3D2>Unfortunately, I=20
  did not use the DropGeometryColumn function. I am also not aware of =
the syntax=20
  of this function because I could not find any information about =
this.</FONT>=20
  <BR><FONT face=3Dsans-serif size=3D2>You wrote me to add the =
GeometryColumn again.=20
  This is just the part which is causing an error. So I am not able to =
add again=20
  a GeometryColumn wiht the previous table name.</FONT> <BR><BR><FONT=20
  face=3Dsans-serif size=3D2>Can you send me the synthay for the =
function=20
  DropGeometryColumn? Then I would try to delete it even if the table =
does not=20
  exist anmore.</FONT> <BR><BR><FONT face=3Dsans-serif =
size=3D2>Thanks</FONT>=20
  <BR><FONT face=3Dsans-serif size=3D2><BR>Christian =
Schuster<BR><BR>Rudolf Schuster=20
  AG<BR>Postfach 277<BR>CH - 3000 Bern =
11<BR><BR>http://www.rsag.ch<BR>++41 31=20
  348 05 30</FONT> <BR><BR><BR>
  <TABLE width=3D"100%">
    <TBODY>
    <TR vAlign=3Dtop>
      <TD width=3D"40%"><FONT face=3Dsans-serif size=3D1><B>"Mark =
Cave-Ayland"=20
        <mark.cave-ayland at webbased.co.uk></B> </FONT>
        <P><FONT face=3Dsans-serif size=3D1>30.01.2003 16:22</FONT> </P>
      <TD width=3D"59%">
        <TABLE width=3D"100%">
          <TBODY>
          <TR>
            <TD>
              <DIV align=3Dright><FONT face=3Dsans-serif =
size=3D1>To</FONT></DIV>
            <TD vAlign=3Dtop><FONT face=3Dsans-serif=20
              size=3D1><christian.schuster at rsag.ch></FONT>=20
          <TR>
            <TD>
              <DIV align=3Dright><FONT face=3Dsans-serif =
size=3D1>cc</FONT></DIV>
            <TD vAlign=3Dtop>
          <TR>
            <TD>
              <DIV align=3Dright><FONT face=3Dsans-serif =
size=3D1>Subject</FONT></DIV>
            <TD vAlign=3Dtop><FONT face=3Dsans-serif size=3D1>RE: =
[Mapserver-users]=20
              How to delete a GIST Index in =
gc_ok</FONT></TR></TBODY></TABLE><BR>
        <TABLE>
          <TBODY>
          <TR vAlign=3Dtop>
            <TD>
            =
<TD></TR></TBODY></TABLE><BR></TR></TBODY></TABLE><BR><BR><BR><BR><BR><FO=
NT=20
  size=3D2>Hi Christian,</FONT> <BR><BR><FONT size=3D2> </FONT> =
<BR><BR><FONT=20
  size=3D2>Did you use the DropGeometryColumnto remove the old geometry =
column=20
  from the geo table? Otherwise you need to add the old geometry column =
back=20
  into your table, then use the function DropGeometryColumnto properly =
remove=20
  it. Once this is done, you should be able to carry on without any =
duplicate=20
  key problems.</FONT> <BR><BR><FONT size=3D2> </FONT> =
<BR><BR><FONT=20
  size=3D2> </FONT> <BR><BR><FONT size=3D2>Hope this helps,</FONT>=20
  <BR><BR><FONT size=3D2> </FONT> <BR><BR><FONT =
size=3D2>Mark.</FONT>=20
  <BR><BR><FONT size=3D2> </FONT> <BR><BR><FONT size=3D2>---</FONT> =

  <BR><BR><FONT size=3D2>Mark Cave-Ayland</FONT> <BR><FONT =
size=3D3>Webbased=20
  Ltd.</FONT> <BR><FONT size=3D3>Tamar Science Park</FONT> <BR><FONT=20
  size=3D3>Derriford</FONT> <BR><FONT size=3D3>Plymouth</FONT> <BR><FONT =
size=3D3>PL6=20
  8BX</FONT> <BR><FONT size=3D3>England</FONT> <BR><BR><FONT =
size=3D3>Tel: +44=20
  (0)1752 764445</FONT> <BR><FONT size=3D3>Fax: +44 (0)1752 =
764446</FONT>=20
  <BR><BR><BR><FONT size=3D3>This email and any attachments are =
confidential to=20
  the intended recipient and may also be privileged. If you are not the =
intended=20
  recipient please delete it from your system and notify the sender. You =
should=20
  not copy it or use it for any purpose nor disclose or distribute its =
contents=20
  to any other person.</FONT> <BR><BR><FONT size=3D2>-----Original=20
  Message-----</FONT> <BR><FONT size=3D2><B>From:</B>=20
  christian.schuster at rsag.ch</FONT><FONT size=3D3>[mailto:</FONT><FONT=20
  size=3D2>christian.schuster at rsag.ch] </FONT><BR><FONT=20
  size=3D2><B>Sent</B></FONT><FONT size=3D3><B>:</B></FONT><FONT =
size=3D2>30=20
  Jan</FONT><FONT size=3D3>uary 2003 13:56</FONT> <BR><FONT =
size=3D3><B>To:</B>=20
  </FONT><FONT size=3D2>mapserver-users at lists.gis.umn.edu</FONT> =
<BR><FONT=20
  size=3D3><B>Subject:</B> [Mapserver-users] How to delete a GIST Index =
in=20
  gc_ok</FONT> <BR><BR><FONT size=3D3> </FONT> <BR><BR><BR><FONT =
size=3D2>Hi=20
  list,</FONT><FONT size=3D3> </FONT><BR><BR><FONT size=3D2>I had a =
table=20
  <B>'geo'</B> with a geometry column of type <B>point</B> and also a =
GIST=20
  index. Then I deleted this table as well as the index belonging to it =
and=20
  create it again. So far okay. But as I wanted to add the geometry =
column I=20
  received the following error message. To work around this problem I =
renamed=20
  the table in to geo2 and then I could add the geometry =
column.</FONT><FONT=20
  size=3D3> </FONT><BR><BR><FONT size=3D2>I am working on Win2000 with =
Cygwin,=20
  PostgreSQL-7.3.1-1 and PostGIS-0.7.3</FONT><FONT size=3D3> =
</FONT><BR><BR><FONT=20
  size=3D2>Does anyone know how to delete the key in index =
gc_ok?</FONT><FONT=20
  size=3D3> </FONT><BR><BR><FONT size=3D2>Thanks for your =
help.</FONT><FONT size=3D3>=20
  </FONT><BR><BR><BR><FONT size=3D2><B>myGISdb=3D# create table geo (ID =
int4, NAME=20
  varchar(20));</B></FONT><FONT size=3D3> </FONT><BR><FONT =
size=3D2><B>CREATE=20
  TABLE</B></FONT><FONT size=3D3> </FONT><BR><FONT =
size=3D2><B>myGISdb=3D# select=20
  addgeometrycolumn('myGISdb', 'geo', 'geom', -1, 'POINT', =
2);</B></FONT><FONT=20
  size=3D3> </FONT><BR><FONT size=3D2><B>ERROR:  Cannot insert a =
duplicate key=20
  into unique index gc_ok</B></FONT><FONT size=3D3> </FONT><BR><FONT=20
  size=3D2><B>WARNING:  Error occurred while executing PL/pgSQL =
function=20
  addgeometrycolumn</B></FONT><FONT size=3D3> </FONT><BR><FONT =
size=3D2><B>WARNING:=20
   Error occurred while executing PL/pgSQL function=20
  addgeometrycolumn</B></FONT><FONT size=3D3> </FONT><BR><FONT =
size=3D2><B>WARNING:=20
   line 39 at execute statement</B></FONT><FONT size=3D3> =
</FONT><BR><FONT=20
  size=3D2><B>WARNING:  line 39 at execute =
statement</B></FONT><FONT size=3D3>=20
  </FONT><BR><FONT size=3D2><B>ERROR:  Cannot insert a duplicate =
key into=20
  unique index gc_ok</B></FONT><FONT size=3D3> </FONT><BR><BR><FONT=20
  size=3D2>Christian Schuster</FONT> <BR><BR><FONT size=3D2>Rudolf =
Schuster=20
  AG</FONT> <BR><FONT size=3D2>Postfach 277</FONT> <BR><FONT size=3D2>CH =
- 3000 Bern=20
  11</FONT> <BR><BR><FONT size=3D2>http://www.rsag.ch</FONT> <BR><FONT =
size=3D2>++41=20
  31 348 05 30</FONT> <BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_004E_01C2C851.AB6D7A20--




More information about the MapServer-users mailing list