Skip to content

Commit 55c18a5

Browse files
committed
[processing] fixed creation of vector layer as PostGIS Table
fixes error introduced in last commit
1 parent b2b6823 commit 55c18a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/plugins/processing/tools/vector.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def _runSQL(sql):
494494
table=uri.table().lower(), schema=uri.schema(), srid=crs.authid().split(":")[-1],
495495
typmod=GEOM_TYPE_MAP[geometryType].upper()))
496496

497-
self.layer = QgsVectorLayer(uri.uri(), uri.table(), "spatialite")
497+
self.layer = QgsVectorLayer(uri.uri(), uri.table(), "postgres")
498498
self.writer = self.layer.dataProvider()
499499
elif self.destination.startswith(self.SPATIALITE_LAYER_PREFIX):
500500
self.isNotFileBased = True
@@ -517,7 +517,7 @@ def _runSQL(sql):
517517
fieldsdesc = ",".join('%s %s' % (f.name(),
518518
TYPE_MAP_SPATIALITE_LAYER.get(f.type(), "VARCHAR"))
519519
for f in fields)
520-
520+
521521
_runSQL("DROP TABLE IF EXISTS %s" % uri.table().lower())
522522
_runSQL("CREATE TABLE %s (%s)" % (uri.table().lower(), fieldsdesc))
523523
_runSQL("SELECT AddGeometryColumn('{table}', 'the_geom', {srid}, '{typmod}', 2)".format(

0 commit comments

Comments
 (0)