[postgis-users] Error messages in PostGIS

Rosangela Silva rosangela.silva at zenitpolar.com.br
Thu May 22 08:02:25 PDT 2003


Hello all,

I'm having two problems with PostGIS that I don't know
how to solve them. I don't have much experience with database
management. Could you help me, please?

I DROP a table continent, but I don't DROP the spatial
index before, and when I try to execute the sql again
I receive the message below:

$ psql -d geobusca -f continent.sql
ERROR:  Relation 'continent' already exists
psql:continent.sql:1: ERROR:  Relation 'continent' already exists
ERROR:  Cannot insert a duplicate key into unique index geometry_columns_pk
WARNING:  Error occurred while executing PL/pgSQL function addgeometrycolumn
WARNING:  line 39 at execute statement
psql:continent.sql:2: WARNING:  line 39 at execute statementng PL/pgSQL function
psql:continent.sql:2: ERROR:  Cannot insert a duplicate key into unique index ge
ometry_columns_pk


In other case, I delete a record from a spatial table and when I try to
insert the same record again (with some changes) I received the message
below:

gisdb=# INSERT INTO wpt (wpt_waypointID, wpt_Name, the_geom) VALUES (9, 'TUN
L25', GeometryFromText('POINT(-46.63758 -23.97345)', 4326));
ERROR:  ExecInsert: rejected due to CHECK constraint "$1" on "wpt"
ERROR:  ExecInsert: rejected due to CHECK constraint "$1" on "wpt"
gisdb=#

I'm using LATLONG/WGS84 and the wpt table is:
               Table "public.wpt"
     Column     |       Type        | Modifiers
--------------------+---------------------+-----------
 wpt_waypointid | bigint            |
 wpt_name        | character varying |
 the_geom        | geometry          |
Check constraints: "$1" (srid(the_geom) = -1)
                   "$2" ((geometrytype(the_geom) = 'POINT'::text) OR (the_geom IS NULL))

But I used the sintaxe bellow to create the table:
CREATE TABLE wpt (wpt_waypointID bigint, wpt_Name varchar);
SELECT AddGeometryColumn('geobusca','wpt','the_geom', 4326,'POINT',2);

What can I have to do?
Thanks

Rosângela.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20030522/31926228/attachment.html>


More information about the postgis-users mailing list