[postgis-users] OGR2OGR -append

Frank Warmerdam warmerdam at pobox.com
Thu Oct 3 06:49:26 PDT 2002


Düster Horst wrote:
> Hi
>  
> I try to import many single shape files into one PostGIS layer. On the list
> I found some messages that an -append option should exists but I never saw
> an explanation how to use this option. When I try to append to an existing
> PostGIS table ogr2ogr breakes with the message:
> Use the layer creation option OVERWRITE=YES to replace it. When I use -lco
> APPEND=YES it doesn't work.
>  
> I'm pleased for any hint.

Dr. Horst,

I have updated the OGR Utilities page to list the -append and -update flags.

   http://gdal.velocet.ca/projects/opengis/ogrhtml/ogr_utilities.html

To append to an existing table, please use both flags, -update indicating you
are updating an existing database, and -append to append to an existing layer
(table).

eg.

% ogr2ogr -update -append PG:dbname=warmerda abc.tab

I have also added a few examples using the OGR utilities to the PostgreSQL
driver page in the ogr formats docs.

   http://gdal.velocet.ca/projects/opengis/ogrhtml/drv_pg.html

Note that the -append support was added in May, and is not in the GDAL/OGR
1.1.7 release.  You can grab an interim code release like the 1.1.7.2
code capture to get this support or work from CVS.

   ftp://gdal.velocet.ca/pub/outgoing/gdal-1.1.7.2.tar.gz

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent






More information about the postgis-users mailing list