Opened 13 years ago
Last modified 13 years ago
#4012 closed defect
OGR2OGR - Postgre import with -nlt flag set to NONE doesn't create a record in geometry_columns anymore — at Initial Version
Reported by: | hsenot | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.8.1 |
Component: | OGR_SF | Version: | 1.8.0 |
Severity: | normal | Keywords: | ogr2ogr pg |
Cc: |
Description
The following command has different results in different versions of the driver: ogr2ogr -f "PostgreSQL" %CS% "test.tab" -nlt NONE -nln test_table where:
- test.tab is a MapInfo file containing a non-spatial layer (just a regular table)
- CS="PG:host='localhost' port='54321' dbname='test_ogr' user='test_ogr' password='test_ogr'"
In GDAL 1.7.1, released 2010/02/08, a record is inserted in geometry_columns. But in both in:
- GDAL 1.8.0, released 2011/01/12
- GDAL 1.9dev, released 2011/01/18
no record is inserted.
This makes it difficult to use OGR2OGR to update/append non-spatial objects. The driver looks for a record in geometry_columns to choose between a create statement (if no record) or an update statement (if record exists) - with the behaviour of driver >= 1.8, it attempts a create on an existing table and thus fails the ogr2ogr statement.
Windows script to reproduce behaviour