[Gdal-dev] Problem with ogr2ogr and PG

Richard Matsunaga richard.matsunaga at waypointinfo.com
Tue Apr 10 14:51:17 EDT 2007


Hi all,
 
I think there is something wrong with the PG driver or ogr2ogr when
appending or overwriting an existing table.
 
I can create a PG table from a shape file just fine, to any schema. However,
when I try to append or overwrite to the table, it will only work if the
schema is the default schema in the search path.
 
My command is as below (names changed to protect innocent). The table was
added using the same command (minus the append stuff) to the public schema.
If I remove the schema in both the first conversion and the append, it will
work, with the table going into the default schema.
 
-------------
 
C:\>ogr2ogr -append -update -f "PostgreSQL" PG:"connection string stuff"
shape.shp -lco SCHEMA=public

ERROR 1: CREATE TABLE public."shape" ( OGC_FID SERIAL, CONSTRAINT "shape_pk"
PRIMARY KEY (OGC_FID) )
ERROR:  relation "shape" already exists
 
ERROR 1: Terminating translation prematurely after failed
translation of layer shape
 
--------------
 
Is there a quick fix to this? I looked briefly at the code, but looks like
it would require some digging in the PG driver.
 
Thanks,
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070410/e69d63f5/attachment.html


More information about the Gdal-dev mailing list