Opened 18 years ago

Closed 14 years ago

#1248 closed enhancement (fixed)

Please add transaction support to ogr2ogr for the postgres driver

Reported by: daniel@… Owned by: Mateusz Łoskot
Priority: low Milestone:
Component: default Version: unspecified
Severity: minor Keywords:
Cc: Markus Neteler

Description

I found out recently that ogr2ogr does not support transactions when inserting into postgres. I believe this is essential when doing large batch imports, such as importing TIGER. It helps avoid duplicate rows from being inserted and should make bulk data loads faster. I imagine a command line argument could be added to the ogr2ogr command line that would then perform all inserts and even DDL in a transaction which would get rolled back on error or abort, and commit on successful exit.

Thanks,

Daniel Ceregatti (AKA Primer on freenode)

Change History (5)

comment:1 by warmerdam, 18 years ago

Mateusz,

Perhaps in late September or October, once you are a PostGIS guru, perhaps
you could look into implementing transactions properly in the PostGIS driver.
Make sure you talk to me as we might need to alter the transaction model 
in OGR to get this right. 

comment:2 by neteler@…, 17 years ago

Hi,

it seems that
http://bugzilla.remotesensing.org/show_bug.cgi?id=1265
contains some related code.

Markus

comment:3 by warmerdam, 17 years ago

Mateusz,

I think the approach to this bug should be to apply the patches from 
#1265 in trunk and then do some serious testing.  I think we should
leave this till after the GDAL 1.4.1 release though since it is to
substantial to back port. 

comment:4 by Mateusz Łoskot, 17 years ago

Frank,

I've reviewed patches from the #1265 but I'm sure they need to be reviewed in very details. OK, let's leave it after 1.4.1.

May be it's a good idea to create a branch where I could play with various approaches and you would be able to checkout and test them too, without messing the trunk?

comment:5 by Even Rouault, 14 years ago

Resolution: fixed
Status: assignedclosed

Transactions are supported by ogr2ogr and the PG driver

Note: See TracTickets for help on using tickets.