[postgis-users] ERROR: duplicate key value violates unique constraint "geometry_columns_pk" on Solaris

Vincent Gay VGay at slb.com
Tue Aug 2 04:56:27 PDT 2011


Hi,

I'm using Postgres 9.0.4 / PostGIS 1.5.3

On a Windows installation, I can execute the following sequence of SQL commands on the current PostGIS enabled database:

create table gistable ();
SELECT AddGeometryColumn('', 'gistable', 'geom', -1, 'POINT', 2);
drop table gistable;
create table gistable ();
SELECT AddGeometryColumn('', 'gistable', 'geom', -1, 'POINT', 2);

No problem, it all works fine.

Now on a Solaris 10 installation, here is what happens if I run the same sequence of commands:

create table gistable ();
SELECT AddGeometryColumn('', 'gistable', 'geom', -1, 'POINT', 2);
drop table gistable;
create table gistable ();
SELECT AddGeometryColumn('', 'gistable', 'geom', -1, 'POINT', 2);

ERROR:  duplicate key value violates unique constraint "geometry_columns_pk"
DETAIL:  Key (f_table_catalog, f_table_schema, f_table_name, f_geometry_column)=(, public, gistable, geom) already exists.
CONTEXT:  SQL statement "INSERT INTO geometry_columns (f_table_catalog,f_table_schema,f_table_name,f_geometry_column,coord_dimension,srid,type) VALUES ('','public','gistable','geom',2,-1,'POINT')"
PL/pgSQL function "addgeometrycolumn" line 147 at EXECUTE statement
SQL statement "SELECT AddGeometryColumn('',$1,$2,$3,$4,$5,$6)"
PL/pgSQL function "addgeometrycolumn" line 4 at SQL statement

********** Error **********

ERROR: duplicate key value violates unique constraint "geometry_columns_pk"
SQL state: 23505
Detail: Key (f_table_catalog, f_table_schema, f_table_name, f_geometry_column)=(, public, gistable, geom) already exists.
Context: SQL statement "INSERT INTO geometry_columns (f_table_catalog,f_table_schema,f_table_name,f_geometry_column,coord_dimension,srid,type) VALUES ('','public','gistable','geom',2,-1,'POINT')"
PL/pgSQL function "addgeometrycolumn" line 147 at EXECUTE statement
SQL statement "SELECT AddGeometryColumn('',$1,$2,$3,$4,$5,$6)"
PL/pgSQL function "addgeometrycolumn" line 4 at SQL statement

So the behavior is not the same even though I'm running the same sequence.
I do not have that problem when running Postgres 8.2.4 / PostGIS 1.3.2

Any idea why Solaris 10 behaves this way?

Thanks,
Vincent


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110802/334f7210/attachment.html>


More information about the postgis-users mailing list