Skip to content

Commit 38d960e

Browse files
author
Sandro Santilli
committed
Use ST_Force2D for PostGIS 2.1+
1 parent a2774a0 commit 38d960e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/providers/postgres/qgspostgresfeatureiterator.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ bool QgsPostgresFeatureIterator::declareCursor( const QString& whereClause )
274274
{
275275
query += QString( "%1(%2(%3%4),'%5')" )
276276
.arg( P->mConnectionRO->majorVersion() < 2 ? "asbinary" : "st_asbinary" )
277-
.arg( P->mConnectionRO->majorVersion() < 2 ? "force_2d" : "st_force_2d" )
277+
.arg( P->mConnectionRO->majorVersion() < 2 ? "force_2d"
278+
: P->mConnectionRO->majorVersion() > 2 || P->mConnectionRO->minorVersion() > 0 ? "ST_Force2D"
279+
: "st_force_2d" )
278280
.arg( P->quotedIdentifier( P->mGeometryColumn ) )
279281
.arg( P->mSpatialColType == sctGeography ? "::geometry" : "" )
280282
.arg( P->endianString() );

0 commit comments

Comments
 (0)