Skip to content

Commit da4c429

Browse files
author
Sandro Santilli
committed
Fix query to detect postgis topology availability.
Closes #9453
1 parent f45e112 commit da4c429

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/providers/postgres/qgspostgresconn.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,8 @@ QString QgsPostgresConn::postgisVersion()
726726
mTopologyAvailable = false;
727727
if ( mPostgisVersionMajor > 1 )
728728
{
729-
QgsPostgresResult result = PQexec( "SELECT count(c.oid) FROM pg_class AS c JOIN pg_namespace AS n ON c.relnamespace=n.oid WHERE n.nspname='topology' AND c.relname='topology'" );
730-
if ( result.PQntuples() >= 1 )
729+
QgsPostgresResult result = PQexec( "SELECT EXISTS ( SELECT c.oid FROM pg_class AS c JOIN pg_namespace AS n ON c.relnamespace=n.oid WHERE n.nspname='topology' AND c.relname='topology' )" );
730+
if ( result.PQntuples() >= 1 && result.PQgetvalue(0, 0) == "t" )
731731
{
732732
mTopologyAvailable = true;
733733
}

0 commit comments

Comments
 (0)