Skip to content

Commit

Permalink
postgres provider: also use fieldExpression used to retrieve values in
Browse files Browse the repository at this point in the history
minimumValue/maximumValue/uniqueValues
  • Loading branch information
jef-n committed Feb 18, 2015
1 parent 4321c09 commit bf56457
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -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() )
Expand All @@ -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() )
Expand Down Expand Up @@ -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() )
Expand Down

0 comments on commit bf56457

Please sign in to comment.