Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -588,9 +588,6 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP
588
588
// catalog doesn't exist in postgresql so we ignore that, but we
589
589
// do need to get the geometry type.
590
590
591
- // Make the assumption that the geometry type for the first
592
- // row is the same as for all other rows.
593
-
594
591
QString tableName = result.PQgetvalue ( i, 0 ); // relname
595
592
QString schemaName = result.PQgetvalue ( i, 1 ); // nspname
596
593
QString column = result.PQgetvalue ( i, 2 ); // attname
@@ -601,8 +598,8 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP
601
598
602
599
// QgsDebugMsg( QString( "%1.%2.%3: %4" ).arg( schemaName ).arg( tableName ).arg( column ).arg( relkind ) );
603
600
604
- layerProperty.types . clear () ;
605
- layerProperty.srids . clear () ;
601
+ layerProperty.types = QList<QGis::WkbType>() << QGis::WKBUnknown ;
602
+ layerProperty.srids = QList< int >() << INT_MIN ;
606
603
layerProperty.schemaName = schemaName;
607
604
layerProperty.tableName = tableName;
608
605
layerProperty.geometryColName = column;
Original file line number Diff line number Diff line change @@ -1318,7 +1318,7 @@ bool QgsPostgresProvider::uniqueData( QString query, QString quotedColNames )
1318
1318
{
1319
1319
Q_UNUSED ( query );
1320
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" )
1321
+ QString sql = QString ( " SELECT count(distinct (%1))=count((%1)) FROM %2%3" )
1322
1322
.arg ( quotedColNames,
1323
1323
mQuery ,
1324
1324
filterWhereClause () );
0 commit comments