Closed billjwilliamson closed 3 years ago
Perhaps related, on loading a layer and starting the "export to pgsql...." dialog I just got this
AttributeError: 'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
File "/usr/share/qgis/python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py", line 137, in parametersHaveChanged
commands = self.algorithm().getConsoleCommands(parameters, context, feedback, executing=False)
File "/usr/share/qgis/python/plugins/processing/algs/gdal/ogr2ogrtopostgislist.py", line 285, in getConsoleCommands
table = layername.lower()
AttributeError: 'NoneType' object has no attribute 'lower'
Python version: 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
QGIS version: 3.18.0-Zürich Zürich, bdef9fb328
XXXX
Is it really the same issue or you consider those two issues as a global PostgreSQL issue ?
@billjwilliamson @Inrap probabli fixed by https://github.com/qgis/QGIS/pull/41847
@gioman it seems to me this issue also occurs in 3.16.4, but the fix was not backported to the 3.16 branch.
@gioman @nyalldawson This still needs to be backported to the LTR branch, which seems to suffer from this issue.
@SrNetoChan the merging of the fix for 3.16 branch (https://github.com/qgis/QGIS/pull/42408) was postponed and it will be available in 3.16.7.
@SrNetoChan the merging of the fix for 3.16 branch (https://github.com/qgis/QGIS/pull/42408) was postponed and it will be available in 3.16.7.
Ah, great. Thanks!
Following #42408, I have modified ogr2ogrtopostgislist.py in Qgis 3.16.6 (from OSGeo4W), but It doesn't change anything : I have the same error Unable to open datasource dbname='activite' with the following drivers.
Is it a normal behaviour ?
@Inrap did you force the reload of the "Processing" plugin, or restart QGIS, after modifying the file?
@agiudiceandrea I quit and reload Qgis each time. (Is there a difference between QGis installed by OSGEo4W and the executable on QGis.org ? I am not sure but it seems that my colleagues who use QGis from QGis.org don't encounter the issue after replacing ogr2ogrtopostgislist.py)
@Inrap there is no difference between the OSGeo4W Network Installer and the QGIS Standalone EXE Installer: the latter is only an all-in-one installer which contains the same packages installed by the former.
Could you provide the "GDAL/OGR console call" generated by the tool and the full log of the tool (redacting the sensitive parts) and your fixed ogr2ogrtopostgislist.py (possibly publishing it on gist/github or elsewhere)?
@agiudiceandrea I nuked my OSGEO4W directory and reinstalled the whole stuff from scratch. Then I have replaced the ogr2ogrtopostgislist.py (in both gdal directory of qgis and qgis-ltr). It works again...I guess I made a mistake somewhere before...Thanks for your attention.
The dialog in PROCESSING TOOLBOX | GDAL | VECTOR MISC | EXPORT TO POSTGRESQL (AVAILABLE CONNECTIONS) is no longer properly parsing input parameters for the target database. Some quoting issue.
Error code
Current workaround; The companion tool EXPORT TO PG (NEW CONNECTION) works fine
On normal package upgrade a regression behaviour has crept into the dialog.
Deleting the existing database connection and recreating it as new, did not fix.
Sample of the dialog console below;
In error
Working (using new connection dialog)
Difference appears to be the
"""
around the PG string.QGIS and OS versions