Skip to content
Permalink
Browse files

postgres provider: fix type retrieval for layers with where clause

  • Loading branch information
jef-n committed Jun 4, 2020
1 parent 724f84d commit 749269c2f331e3d21d5fa7e36e2438f48f8bac58
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/providers/postgres/qgspostgresconn.cpp
@@ -1755,10 +1755,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 749269c

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