<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o = "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm having two problems with PostGIS that I don't
know<BR>how to solve them. I don't have much experience with
database<BR>management. Could you help me, please?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I DROP a table continent, but I don't DROP the
spatial<BR>index before, and when I try to execute the sql again<BR>I receive
the message below:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>$ psql -d geobusca -f continent.sql<BR>ERROR:
Relation 'continent' already exists<BR>psql:continent.sql:1: ERROR:
Relation 'continent' already exists<BR>ERROR: Cannot insert a duplicate
key into unique index geometry_columns_pk<BR>WARNING: Error occurred while
executing PL/pgSQL function addgeometrycolumn<BR>WARNING: line 39 at
execute statement<BR>psql:continent.sql:2: WARNING: line 39 at execute
statementng PL/pgSQL function<BR>psql:continent.sql:2: ERROR: Cannot
insert a duplicate key into unique index ge<BR>ometry_columns_pk</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>In other case, I delete a record from a spatial table and when I try
to<BR>insert the same record again (with some changes) I received the
message<BR>below:</DIV>
<DIV> </DIV>
<DIV>gisdb=# INSERT INTO wpt (wpt_waypointID, wpt_Name, the_geom) VALUES (9,
'TUN<BR>L25', GeometryFromText('POINT(-46.63758 -23.97345)',
4326));<BR>ERROR: ExecInsert: rejected due to CHECK constraint "$1" on
"wpt"<BR>ERROR: ExecInsert: rejected due to CHECK constraint "$1" on
"wpt"<BR>gisdb=#</DIV>
<DIV> </DIV>
<DIV>I'm using LATLONG/WGS84 and the wpt table is:</DIV>
<DIV>
Table "public.wpt"<BR> Column
|
Type |
Modifiers<BR>--------------------+---------------------+-----------<BR> wpt_waypointid
| bigint
|<BR> wpt_name | character
varying |<BR> the_geom |
geometry |<BR>Check
constraints: "$1" (srid(the_geom) =
-1)<BR>
"$2" ((geometrytype(the_geom) = 'POINT'::text) OR (the_geom IS NULL))<BR></DIV>
<DIV>But I used the sintaxe bellow to create the table:</DIV>
<DIV>CREATE TABLE wpt (wpt_waypointID bigint, wpt_Name varchar);<BR>SELECT
AddGeometryColumn('geobusca','wpt','the_geom', 4326,'POINT',2);</DIV>
<DIV><BR>What can I have to do?<BR>Thanks</DIV>
<DIV> </DIV>
<DIV>Rosāngela.</FONT></DIV></BODY></HTML>