Opened 4 years ago

Closed 4 years ago

#6141 closed defect (fixed)

ogr2ogr fails to create multiple geometry columns on postgis when using the lco SCHEMA

Reported by: tumasgiu Owned by: warmerdam
Priority: normal Milestone: 1.11.4
Component: OGR_SF Version: 1.11.2
Severity: normal Keywords: ogr2ogr postgis
Cc:

Description

When using ogr2ogr command like this :

ogr2ogr.exe -lco SCHEMA=myschema -dialect SQLITE 
-f Postgresql PG:"dbname=test user='postgres'"  EDIGEOA1.THF 
-sql "SELECT foo.id,bar.geometry AS poly, foo.geometry AS point 
      FROM foo left join bar using id = ptr"

It fails at creating the new geometrycolumns. Inspecting the database log it seems that ogr2ogr try the following statement :

SELECT AddGeometryColumn('myschema','myschema.select','point',900915,'POINT',2)

which is wrong ( the second parameter must be table name only, not a full qualified name ).

A turnaround is to use the active_schema option of the PG connection string.

Change History (1)

comment:1 Changed 4 years ago by Even Rouault

Component: UtilitiesOGR_SF
Milestone: 1.11.4
Resolution: fixed
Status: newclosed

branches/1.11 r30850 "PG: fix creation of multiple geometry fields with SCHEMA creation option (#6141)"

2.0 was already OK

Note: See TracTickets for help on using tickets.