Opened 13 years ago

Closed 10 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


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.


Daniel Ceregatti (AKA Primer on freenode)

Change History (5)

comment:1 Changed 13 years ago by warmerdam


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 Changed 13 years ago by neteler@…


it seems that
contains some related code.


comment:3 Changed 13 years ago by warmerdam


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 Changed 13 years ago by Mateusz Łoskot


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 Changed 10 years ago by Even Rouault

Resolution: fixed
Status: assignedclosed

Transactions are supported by ogr2ogr and the PG driver

Note: See TracTickets for help on using tickets.