https://issues.qgis.org/https://issues.qgis.org/favicon.ico2014-01-29T09:02:53ZQGIS Issue TrackingQGIS Application - Bug report #9453: ERROR: schema "topology" does not existhttps://issues.qgis.org/issues/9453?journal_id=478552014-01-29T09:02:53ZJürgen Fischerjef@norbit.de
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Fixed in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/7456eb7924edd0a660ca98b3e6d7517bdce2fea8" title="postgres provider: don't look for topology layers without topology support (fixes #9453)">7456eb7924edd0a660ca98b3e6d7517bdce2fea8</a>.</p> QGIS Application - Bug report #9453: ERROR: schema "topology" does not existhttps://issues.qgis.org/issues/9453?journal_id=481022014-02-03T01:45:13ZSandro Santillistrk@kbt.io
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>Sorry but I cannot confirm the fix. Could be a problem on my side but as of f45e112 I still see the error:</p>
<pre>
src/providers/postgres/qgspostgresconn.cpp: 385: (getTableInfo) getting table info: SELECT l.table_name,l.schema_name,l.feature_column,CASE WHEN l.feature_type = 1 THEN 'MULTIPOINT' WHEN l.feature_type = 2 THEN 'MULTILINESTRING' WHEN l.feature_type = 3 THEN 'MULTIPOLYGON' WHEN l.feature_type = 4 THEN 'GEOMETRYCOLLECTION' END AS type,(SELECT srid FROM topology.topology t WHERE l.topology_id=t.id),c.relkind FROM topology.layer l,pg_class c,pg_namespace n WHERE c.relname=l.table_name AND l.schema_name=n.nspname AND n.oid=c.relnamespace AND has_schema_privilege(n.nspname,'usage') AND has_table_privilege('"'||n.nspname||'"."'||c.relname||'"','select') ORDER BY n.nspname,c.relname,l.feature_column
src/providers/postgres/qgspostgresconn.cpp: 805: (PQexec) Not logged erroneous query: SELECT l.table_name,l.schema_name,l.feature_column,CASE WHEN l.feature_type = 1 THEN 'MULTIPOINT' WHEN l.feature_type = 2 THEN 'MULTILINESTRING' WHEN l.feature_type = 3 THEN 'MULTIPOLYGON' WHEN l.feature_type = 4 THEN 'GEOMETRYCOLLECTION' END AS type,(SELECT srid FROM topology.topology t WHERE l.topology_id=t.id),c.relkind FROM topology.layer l,pg_class c,pg_namespace n WHERE c.relname=l.table_name AND l.schema_name=n.nspname AND n.oid=c.relnamespace AND has_schema_privilege(n.nspname,'usage') AND has_table_privilege('"'||n.nspname||'"."'||c.relname||'"','select') ORDER BY n.nspname,c.relname,l.feature_column returned 7 [ERROR: schema "topology" does not exist
LINE 1: ...pology t WHERE l.topology_id=t.id),c.relkind FROM topology.l...
^
]
WARNING: there is no transaction in progress
</pre> QGIS Application - Bug report #9453: ERROR: schema "topology" does not existhttps://issues.qgis.org/issues/9453?journal_id=481032014-02-03T03:53:44ZSandro Santillistrk@kbt.io
<ul><li><strong>Assignee</strong> set to <i>Sandro Santilli</i></li></ul><p>Found the bug, is in the function checking for topology support:</p>
<p>+ 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'" );<br />+ if ( result.PQntuples() >= 1 )<br />+ {<br />+ mTopologyAvailable = true;<br />+ }<br />+ }</p>
<p>Should indeed be looking at the count, since the query is:</p> QGIS Application - Bug report #9453: ERROR: schema "topology" does not existhttps://issues.qgis.org/issues/9453?journal_id=481042014-02-03T03:54:04ZSandro Santillistrk@kbt.io
<ul></ul><p>Besides, may I suggest to look at the "TOPOLOGY" label in output from postgis_full_version() instead ?</p> QGIS Application - Bug report #9453: ERROR: schema "topology" does not existhttps://issues.qgis.org/issues/9453?journal_id=481052014-02-03T03:55:04ZSandro Santillistrk@kbt.io
<ul></ul><p>Like this (will test after lunch):</p>
<pre>
diff --git a/src/providers/postgres/qgspostgresconn.cpp b/src/providers/postgres/qgspostgresconn.cpp
index b4eaf1e..311a0fc 100644
--- a/src/providers/postgres/qgspostgresconn.cpp
+++ b/src/providers/postgres/qgspostgresconn.cpp
@@ -719,17 +719,10 @@ QString QgsPostgresConn::postgisVersion()
{
mProjAvailable = ( proj[0].indexOf( "=1" ) > -1 );
}
- }
-
- // checking for topology support
- QgsDebugMsg( "Checking for topology support" );
- 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 )
+ QStringList proj = postgisParts.filter( "TOPOLOGY" );
+ if ( proj.size() == 1 )
{
- mTopologyAvailable = true;
+ mTopologyAvailable = ( proj[0].indexOf( "=1" ) > -1 );
}
}
</pre> QGIS Application - Bug report #9453: ERROR: schema "topology" does not existhttps://issues.qgis.org/issues/9453?journal_id=481062014-02-03T05:08:01ZSandro Santillistrk@kbt.io
<ul></ul><p>Sorry for the noise, the version string is extracted using "postgis_version()", not "postgis_full_version()", so can't check for TOPOLOGY. Also the topology.topology trick woudl support pre-2.0 installs of postgis topology which is good.</p> QGIS Application - Bug report #9453: ERROR: schema "topology" does not existhttps://issues.qgis.org/issues/9453?journal_id=481072014-02-03T05:26:21ZSandro Santillistrk@kbt.io
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li></ul><p>Fixed in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/da4c4292374d049fde2c238a20a0b726ee9cf48d" title="Fix query to detect postgis topology availability. Closes #9453">da4c4292374d049fde2c238a20a0b726ee9cf48d</a>.</p> QGIS Application - Bug report #9453: ERROR: schema "topology" does not existhttps://issues.qgis.org/issues/9453?journal_id=481082014-02-03T05:30:06ZSandro Santillistrk@kbt.io
<ul><li><strong>Resolution</strong> set to <i>fixed/implemented</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>NOTE: backported to 2.0 branch with <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/673406d271fbc54071c3cc8835fb1279e4ebe719" title="postgres provider: don't look for topology layers without topology support (fixes #9453)">673406d271fbc54071c3cc8835fb1279e4ebe719</a> and <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/f8028087ad533307774c79afceb3580d27466664" title="Fix query to detect postgis topology availability. Closes #9453">f8028087ad533307774c79afceb3580d27466664</a></p>