Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#6612 closed defect (fixed)

gdal.VectorTranslate doesn't handle properly the connection

Reported by: yjacolin Owned by: hobu
Priority: normal Milestone: 2.1.2
Component: Utilities Version: 2.1.0
Severity: normal Keywords:
Cc:

Description

gdal.VectorTranslate() doesn't currently properly handle the situation where you pass a dstDS object but not specify accessMode to be 'append', 'update' or 'overwrite'.

Example of code:

dstDS = gdal.OpenEx(connectionString)

for id in idList:

    srcDS = gdal.OpenEx('/tmp/file_' + str(id) + '.geojson')

    gdal.VectorTranslate(
     dstDS,
     srcDS,
     format = 'PostgreSQL',
     layerName='myLayer'
   )
   del srcDS

del dstDS

Result: PostgreSQL fatal error: too many clients already.

Change History (3)

comment:1 Changed 10 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 34857:

GDALVectorTranslate(): imply update mode if access mode not explicitly specified and hDstDS != NULL (fixes #6612)

comment:2 Changed 10 months ago by Even Rouault

In 34858:

GDALVectorTranslate(): imply update mode if access mode not explicitly specified and hDstDS != NULL (fixes #6612)

comment:3 Changed 10 months ago by Even Rouault

Component: PythonBindingsUtilities
Milestone: 2.1.2
Version: 2.1.12.1.0
Note: See TracTickets for help on using tickets.