[Gdal-dev] ogr2ogr PostgreSQL and INTERLIS issues

Frank Warmerdam warmerdam at pobox.com
Wed Oct 24 12:07:14 EDT 2007


Andreas Neumann wrote:
> Despite my flags "append" and "update" ogr2ogr is trying to create a new
> table. I get the following error message:
> 
> ----------------------
> ERROR 1: CREATE TABLE av."Bodenbedeckung__BoFlaeche" ( OGC_FID SERIAL,
> CONSTRAINT "Bodenbedeckung__BoFlaeche_pk" PRIMARY KEY (OGC_FID) )
> ERROR:  relation "Bodenbedeckung__BoFlaeche" already exists
> 
> ERROR 1: Terminating translation prematurely after failed
> translation of layer Bodenbedeckung__BoFlaeche
> -----------------------
> 
> I know that this table already exists, but why is it trying to recreate it
> if I specify update and append?

Andreas,

This is because ogr2ogr does not find the existing table as a layer,
presumably because it is not listed in the GEOMETRY_COLUMNS table as
is expected for geometry based tables.

> * ili file required?
> In Interlis, the model is specified in the ili file and the data in the
> itf file. My assumption is that the ili file is only necessary in the case
> when I need to create a new data model/table structure and not for
> importing data into existing tables. Is this assumption wrong? When I try
> to omit the ili file, ogr2ogr crashes with the following error message:
> 
> Segmentation fault (core dumped)

I'm a bit fuzzy on this aspect.  Pirmin is the authority.

But the crash seems like an unacceptable result, and I'd appreciate a bug
report on it.

> * temporary SQL files:
> My assumption is that ogr2ogr somewhere creates temporary SQL files that
> it is later feeding into PostgreSQL. Is that correct? Or is there a direct
> connection to the database and not temporary SQL file? If I can find these
> temporary SQL files I might be able to fix errors myself before loading
> the SQL files into Postgis.

It is done by directly submitting SQL statements to postgres through
libpq.  There is no file on disk.

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list