@@ -92,20 +92,22 @@ def processAlgorithm(self, progress):
92
92
if not geomColumn :
93
93
geomColumn = 'the_geom'
94
94
95
- uri = QgsDataSourceURI ()
96
- uri .setConnection (host , str (port ), database , username , password )
97
- if primaryKeyField :
98
- uri .setDataSource (schema , table , geomColumn , '' , primaryKeyField )
99
- else :
100
- uri .setDataSource (schema , table , geomColumn , '' )
101
-
102
95
options = {}
103
96
if overwrite :
104
97
options ['overwrite' ] = True
105
98
if convertLowerCase :
106
99
options ['lowercaseFieldNames' ] = True
100
+ geomColumn = geomColumn .lower ()
107
101
if dropStringLength :
108
102
options ['dropStringConstraints' ] = True
103
+
104
+ uri = QgsDataSourceURI ()
105
+ uri .setConnection (host , str (port ), database , username , password )
106
+ if primaryKeyField :
107
+ uri .setDataSource (schema , table , geomColumn , '' , primaryKeyField )
108
+ else :
109
+ uri .setDataSource (schema , table , geomColumn , '' )
110
+
109
111
layerUri = self .getParameterValue (self .INPUT )
110
112
layer = dataobjects .getObjectFromUri (layerUri )
111
113
(ret , errMsg ) = QgsVectorLayerImport .importLayer (
0 commit comments