Skip to content
Permalink
Browse files

postgres: use st_estimatedextent with postgis >= 2.1 (fixes #9011)

  • Loading branch information
jef-n committed Nov 17, 2013
1 parent 7e17a84 commit 99cee10cf96314ae911a6d8b99d6a43015a3cf83
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/providers/postgres/qgspostgresprovider.cpp
@@ -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 ) );

0 comments on commit 99cee10

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