Skip to content
Permalink
Browse files
[BUGFIX] Fixes QgsPostgresProviderConnection::createSpatialIndex. Add…
…s quotedIdentifier to avoid failure when indexName contains 'invalid' characters
  • Loading branch information
lbartoletti authored and github-actions committed Apr 27, 2021
1 parent 5eaf26b commit f773810762f6562d844baecef51f827c79f5b228
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/providers/postgres/qgspostgresproviderconnection.cpp
@@ -400,7 +400,7 @@ void QgsPostgresProviderConnection::createSpatialIndex( const QString &schema, c

const QString indexName = QStringLiteral( "sidx_%1_%2" ).arg( name, geometryColumnName );
executeSql( QStringLiteral( "CREATE INDEX %1 ON %2.%3 USING GIST (%4);" )
.arg( indexName,
.arg( QgsPostgresConn::quotedIdentifier( indexName ),
QgsPostgresConn::quotedIdentifier( schema ),
QgsPostgresConn::quotedIdentifier( name ),
QgsPostgresConn::quotedIdentifier( geometryColumnName ) ) );

0 comments on commit f773810

Please sign in to comment.