Skip to content
Permalink
Browse files

postgres provider: fix type retrieval for layers with where clause

(cherry picked from commit 749269c)
  • Loading branch information
jef-n committed Jun 4, 2020
1 parent 537a247 commit f4e58106f0a56f7f44b316e977518cf0a54324ed
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/providers/postgres/qgspostgresconn.cpp
@@ -1758,10 +1758,10 @@ void QgsPostgresConn::retrieveLayerTypes( QVector<QgsPostgresLayerProperty *> &l
// our estimatation ignores that a where clause might restrict the feature type or srid
if ( useEstimatedMetadata )
{
table = QStringLiteral( "(SELECT %1 FROM %2%3 WHERE %1 IS NOT NULL LIMIT %4) AS t" )
table = QStringLiteral( "(SELECT %1 FROM %2 WHERE %3%1 IS NOT NULL LIMIT %4) AS t" )
.arg( quotedIdentifier( layerProperty.geometryColName ),
table,
layerProperty.sql.isEmpty() ? QString() : QStringLiteral( " WHERE %1" ).arg( layerProperty.sql ) )
layerProperty.sql.isEmpty() ? QString() : QStringLiteral( " (%1) AND " ).arg( layerProperty.sql ) )
.arg( GEOM_TYPE_SELECT_LIMIT );
}
else if ( !layerProperty.sql.isEmpty() )

0 comments on commit f4e5810

Please sign in to comment.
You can’t perform that action at this time.