Skip to content

Commit 8300521

Browse files
committedJul 13, 2015
Revert "use triple quoting with st_estimatedextent in postgres provider and db_manager (fixes #12478)"
As it seems to address a meanwhile reverted behavior change in PostGIS 2.1 before it was released (see also https://trac.osgeo.org/postgis/ticket/2834). This reverts commit 048aff0. (cherry picked from commit e4410abb93e74ca6e85e11f5916e8c07c417e06f)
1 parent 174dca2 commit 8300521

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎python/plugins/db_manager/db_plugins/postgis/connector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,10 @@ def getTableEstimatedExtent(self, table, geom):
572572
return
573573

574574
schema, tablename = self.getSchemaTableName(table)
575-
schema_part = u"%s," % self.quoteString( self.quoteId( schema) ) if schema is not None else ""
575+
schema_part = u"%s," % self.quoteString(schema) if schema is not None else ""
576576

577577
subquery = u"SELECT st_estimated_extent(%s%s,%s) AS extent" % (
578-
schema_part, self.quoteString( self.quoteId( tablename) ), self.quoteString(geom))
578+
schema_part, self.quoteString(tablename), self.quoteString(geom))
579579
sql = u"""SELECT st_xmin(extent), st_ymin(extent), st_xmax(extent), st_ymax(extent) FROM (%s) AS subquery """ % subquery
580580

581581
try:

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,8 +2487,8 @@ QgsRectangle QgsPostgresProvider::extent()
24872487
sql = QString( "SELECT %1(%2,%3,%4)" )
24882488
.arg( connectionRO()->majorVersion() < 2 ? "estimated_extent" :
24892489
( connectionRO()->majorVersion() == 2 && connectionRO()->minorVersion() < 1 ? "st_estimated_extent" : "st_estimatedextent" ) )
2490-
.arg( quotedValue( quotedIdentifier( mSchemaName ) ) )
2491-
.arg( quotedValue( quotedIdentifier( mTableName ) ) )
2490+
.arg( quotedValue( mSchemaName ) )
2491+
.arg( quotedValue( mTableName ) )
24922492
.arg( quotedValue( mGeometryColumn ) );
24932493
result = mConnectionRO->PQexec( sql );
24942494
if ( result.PQresultStatus() == PGRES_TUPLES_OK && result.PQntuples() == 1 && !result.PQgetisnull( 0, 0 ) )

0 commit comments

Comments
 (0)
Please sign in to comment.