Skip to content

Commit

Permalink
postgres: use st_estimatedextent with postgis >= 2.1 (fixes #9011)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Nov 17, 2013
1 parent 7e17a84 commit 99cee10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2408,7 +2408,8 @@ QgsRectangle QgsPostgresProvider::extent()
&& result.PQgetvalue( 0, 0 ).toLong() > 0 )
{
sql = QString( "SELECT %1(%2,%3,%4)" )
.arg( mConnectionRO->majorVersion() < 2 ? "estimated_extent" : "st_estimated_extent" )
.arg( mConnectionRO->majorVersion() < 2 ? "estimated_extent" :
(mConnectionRO->majorVersion() == 2 && mConnectionRO->minorVersion() < 1 ? "st_estimated_extent" : "st_estimatedextent" ) )
.arg( quotedValue( mSchemaName ) )
.arg( quotedValue( mTableName ) )
.arg( quotedValue( mGeometryColumn ) );
Expand Down

0 comments on commit 99cee10

Please sign in to comment.