Opened 8 years ago

Closed 8 years ago

Last modified 8 years 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 by Even Rouault, 8 years ago

Resolution: fixed
Status: newclosed

In 34857:

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

comment:2 by Even Rouault, 8 years ago

In 34858:

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

comment:3 by Even Rouault, 8 years ago

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