Skip to content
Permalink
Browse files
Fix query to detect postgis topology availability.
Closes #9453
  • Loading branch information
Sandro Santilli committed Feb 3, 2014
1 parent 673406d commit f8028087ad533307774c79afceb3580d27466664
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/providers/postgres/qgspostgresconn.cpp
@@ -712,8 +712,8 @@ QString QgsPostgresConn::postgisVersion()
mTopologyAvailable = false;
if ( mPostgisVersionMajor > 1 )
{
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'" );
if ( result.PQntuples() >= 1 )
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' )" );
if ( result.PQntuples() >= 1 && result.PQgetvalue(0, 0) == "t" )
{
mTopologyAvailable = true;
}

0 comments on commit f802808

Please sign in to comment.