Skip to content

Instantly share code, notes, and snippets.

@jef-n
Created June 24, 2015 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jef-n/2a56807d8221822b0674 to your computer and use it in GitHub Desktop.
Save jef-n/2a56807d8221822b0674 to your computer and use it in GitHub Desktop.
diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp
index 19516e7..98bd7a9 100644
--- a/src/providers/postgres/qgspostgresprovider.cpp
+++ b/src/providers/postgres/qgspostgresprovider.cpp
@@ -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( mSchemaName ) )
- .arg( quotedValue( mTableName ) )
+ .arg( quotedValue( quotedIdentifier( mSchemaName ) ) )
+ .arg( quotedValue( quotedIdentifier( mTableName ) ) )
.arg( quotedValue( mGeometryColumn ) );
result = mConnectionRO->PQexec( sql );
if ( result.PQresultStatus() == PGRES_TUPLES_OK && result.PQntuples() == 1 && !result.PQgetisnull( 0, 0 ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment