Skip to content
Permalink
Browse files

postgres provider: also use fieldExpression used to retrieve values in

minimumValue/maximumValue/uniqueValues
  • Loading branch information
jef-n committed Feb 18, 2015
1 parent 4321c09 commit bf56457a71a5777675da04715f09a45df19ea4a1
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/providers/postgres/qgspostgresprovider.cpp
@@ -1235,7 +1235,7 @@ QVariant QgsPostgresProvider::minimumValue( int index )
// get the field name
const QgsField &fld = field( index );
QString sql = QString( "SELECT min(%1) FROM %2" )
.arg( quotedIdentifier( fld.name() ) )
.arg( connectionRO()->fieldExpression( fld ) )
.arg( mQuery );

if ( !mSqlWhereClause.isEmpty() )
@@ -1262,7 +1262,7 @@ void QgsPostgresProvider::uniqueValues( int index, QList<QVariant> &uniqueValues
// get the field name
const QgsField &fld = field( index );
QString sql = QString( "SELECT DISTINCT %1 FROM %2" )
.arg( quotedIdentifier( fld.name() ) )
.arg( connectionRO()->fieldExpression( fld ) )
.arg( mQuery );

if ( !mSqlWhereClause.isEmpty() )
@@ -1408,7 +1408,7 @@ QVariant QgsPostgresProvider::maximumValue( int index )
// get the field name
const QgsField &fld = field( index );
QString sql = QString( "SELECT max(%1) FROM %2" )
.arg( quotedIdentifier( fld.name() ) )
.arg( connectionRO()->fieldExpression( fld ) )
.arg( mQuery );

if ( !mSqlWhereClause.isEmpty() )

0 comments on commit bf56457

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