Skip to content

Commit 772adec

Browse files
committed
[bugfix] Respect multi-single part when importing
Fixes #15875
1 parent faec620 commit 772adec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/providers/postgres/qgspostgresdataitems.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ bool QgsPGConnectionItem::handleDrop( const QMimeData *data, const QString &toSc
244244
uri.setSchema( toSchema );
245245
}
246246

247-
std::unique_ptr< QgsVectorLayerExporterTask > exportTask( new QgsVectorLayerExporterTask( srcLayer, uri.uri( false ), QStringLiteral( "postgres" ), srcLayer->crs(), QVariantMap(), owner ) );
247+
QVariantMap options;
248+
options.insert( QStringLiteral( "forceSinglePartGeometryType" ), true );
249+
std::unique_ptr< QgsVectorLayerExporterTask > exportTask( new QgsVectorLayerExporterTask( srcLayer, uri.uri( false ), QStringLiteral( "postgres" ), srcLayer->crs(), options, owner ) );
248250

249251
// when export is successful:
250252
connect( exportTask.get(), &QgsVectorLayerExporterTask::exportComplete, this, [ = ]()

0 commit comments

Comments
 (0)