@@ -497,9 +497,9 @@ long long QgsPostgresProviderResultIterator::rowCountPrivate() const
497
497
void QgsPostgresProviderConnection::vacuum ( const QString &schema, const QString &name ) const
498
498
{
499
499
checkCapability ( Capability::Vacuum );
500
- executeSql ( QStringLiteral ( " VACUUM FULL ANALYZE %1.%2" )
501
- .arg ( QgsPostgresConn::quotedIdentifier ( schema ),
502
- QgsPostgresConn::quotedIdentifier ( name ) ) );
500
+ executeSqlPrivate ( QStringLiteral ( " VACUUM FULL ANALYZE %1.%2" )
501
+ .arg ( QgsPostgresConn::quotedIdentifier ( schema ),
502
+ QgsPostgresConn::quotedIdentifier ( name ) ), false );
503
503
}
504
504
505
505
void QgsPostgresProviderConnection::createSpatialIndex ( const QString &schema, const QString &name, const QgsAbstractDatabaseProviderConnection::SpatialIndexOptions &options ) const
@@ -527,11 +527,11 @@ void QgsPostgresProviderConnection::createSpatialIndex( const QString &schema, c
527
527
}
528
528
529
529
const QString indexName = QStringLiteral ( " sidx_%1_%2" ).arg ( name, geometryColumnName );
530
- executeSql ( QStringLiteral ( " CREATE INDEX %1 ON %2.%3 USING GIST (%4);" )
531
- .arg ( QgsPostgresConn::quotedIdentifier ( indexName ),
532
- QgsPostgresConn::quotedIdentifier ( schema ),
533
- QgsPostgresConn::quotedIdentifier ( name ),
534
- QgsPostgresConn::quotedIdentifier ( geometryColumnName ) ) );
530
+ executeSqlPrivate ( QStringLiteral ( " CREATE INDEX %1 ON %2.%3 USING GIST (%4);" )
531
+ .arg ( QgsPostgresConn::quotedIdentifier ( indexName ),
532
+ QgsPostgresConn::quotedIdentifier ( schema ),
533
+ QgsPostgresConn::quotedIdentifier ( name ),
534
+ QgsPostgresConn::quotedIdentifier ( geometryColumnName ) ), false );
535
535
}
536
536
537
537
bool QgsPostgresProviderConnection::spatialIndexExists ( const QString &schema, const QString &name, const QString &geometryColumn ) const
@@ -582,8 +582,8 @@ void QgsPostgresProviderConnection::deleteSpatialIndex( const QString &schema, c
582
582
583
583
const QString indexName = res.at ( 0 ).at ( 0 ).toString ();
584
584
585
- executeSql ( QStringLiteral ( " DROP INDEX %1.%2" ).arg ( QgsPostgresConn::quotedIdentifier ( schema ),
586
- QgsPostgresConn::quotedIdentifier ( indexName ) ) );
585
+ executeSqlPrivate ( QStringLiteral ( " DROP INDEX %1.%2" ).arg ( QgsPostgresConn::quotedIdentifier ( schema ),
586
+ QgsPostgresConn::quotedIdentifier ( indexName ) ), false );
587
587
}
588
588
589
589
QList<QgsPostgresProviderConnection::TableProperty> QgsPostgresProviderConnection::tables ( const QString &schema, const TableFlags &flags ) const
@@ -676,16 +676,16 @@ QList<QgsPostgresProviderConnection::TableProperty> QgsPostgresProviderConnectio
676
676
{
677
677
try
678
678
{
679
- const auto pks = executeSql ( QStringLiteral ( R"(
679
+ const QList<QVariantList> pks = executeSqlPrivate ( QStringLiteral ( R"(
680
680
WITH pkrelid AS (
681
681
SELECT indexrelid AS idxri FROM pg_index WHERE indrelid='%1.%2'::regclass AND (indisprimary OR indisunique)
682
682
ORDER BY CASE WHEN indisprimary THEN 1 ELSE 2 END LIMIT 1)
683
683
SELECT attname FROM pg_index,pg_attribute, pkrelid
684
684
WHERE indexrelid=pkrelid.idxri AND indrelid=attrelid AND pg_attribute.attnum=any(pg_index.indkey);
685
685
)" ).arg ( QgsPostgresConn::quotedIdentifier ( pr.schemaName ),
686
- QgsPostgresConn::quotedIdentifier ( pr.tableName ) ) );
686
+ QgsPostgresConn::quotedIdentifier ( pr.tableName ) ), false );
687
687
QStringList pkNames;
688
- for ( const auto &pk : std::as_const ( pks ) )
688
+ for ( const QVariantList &pk : std::as_const ( pks ) )
689
689
{
690
690
pkNames.push_back ( pk.first ().toString () );
691
691
}
0 commit comments