File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1314,12 +1314,12 @@ void QgsPostgresProvider::determinePrimaryKeyFromUriKeyColumn()
1314
1314
}
1315
1315
}
1316
1316
1317
- bool QgsPostgresProvider::uniqueData ( QString query, QString quotedColName )
1317
+ bool QgsPostgresProvider::uniqueData ( QString query, QString quotedColNames )
1318
1318
{
1319
1319
Q_UNUSED ( query );
1320
- // Check to see if the given column contains unique data
1321
- QString sql = QString ( " SELECT count(distinct %1)=count(%1 ) FROM %2%3" )
1322
- .arg ( quotedColName ,
1320
+ // Check to see if the given columns contain unique data
1321
+ QString sql = QString ( " SELECT count(distinct ( %1)) =count((%1)) AND bool_and((%1) IS NOT NULL ) FROM %2%3" )
1322
+ .arg ( quotedColNames ,
1323
1323
mQuery ,
1324
1324
filterWhereClause () );
1325
1325
Original file line number Diff line number Diff line change @@ -456,9 +456,9 @@ class QgsPostgresProvider : public QgsVectorDataProvider
456
456
QString mWhat ;
457
457
};
458
458
459
- // A function that determines if the given schema.table.column
460
- // contains unqiue entries
461
- bool uniqueData ( QString query, QString colName );
459
+ // A function that determines if the given columns
460
+ // contain unique entries
461
+ bool uniqueData ( QString query, QString quotedColNames );
462
462
463
463
int mEnabledCapabilities ;
464
464
You can’t perform that action at this time.
0 commit comments