mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
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 048aff01bb9cf42e2c1c17eb0ddbd81537443e19.
This commit is contained in:
parent
63e18501a5
commit
48e4fb85c8
@ -572,10 +572,10 @@ class PostGisDBConnector(DBConnector):
|
||||
return
|
||||
|
||||
schema, tablename = self.getSchemaTableName(table)
|
||||
schema_part = u"%s," % self.quoteString( self.quoteId( schema) ) if schema is not None else ""
|
||||
schema_part = u"%s," % self.quoteString(schema) if schema is not None else ""
|
||||
|
||||
subquery = u"SELECT st_estimated_extent(%s%s,%s) AS extent" % (
|
||||
schema_part, self.quoteString( self.quoteId( tablename) ), self.quoteString(geom))
|
||||
schema_part, self.quoteString(tablename), self.quoteString(geom))
|
||||
sql = u"""SELECT st_xmin(extent), st_ymin(extent), st_xmax(extent), st_ymax(extent) FROM (%s) AS subquery """ % subquery
|
||||
|
||||
try:
|
||||
|
@ -2487,8 +2487,8 @@ QgsRectangle QgsPostgresProvider::extent()
|
||||
sql = QString( "SELECT %1(%2,%3,%4)" )
|
||||
.arg( connectionRO()->majorVersion() < 2 ? "estimated_extent" :
|
||||
( connectionRO()->majorVersion() == 2 && connectionRO()->minorVersion() < 1 ? "st_estimated_extent" : "st_estimatedextent" ) )
|
||||
.arg( quotedValue( quotedIdentifier( mSchemaName ) ) )
|
||||
.arg( quotedValue( quotedIdentifier( mTableName ) ) )
|
||||
.arg( quotedValue( mSchemaName ) )
|
||||
.arg( quotedValue( mTableName ) )
|
||||
.arg( quotedValue( mGeometryColumn ) );
|
||||
result = mConnectionRO->PQexec( sql );
|
||||
if ( result.PQresultStatus() == PGRES_TUPLES_OK && result.PQntuples() == 1 && !result.PQgetisnull( 0, 0 ) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user