<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Nico,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>Also check that the spatial tables have a spatial index, an integer unique key and run an ST_IsValid() check from Postgis on the geometries to ensure the data is clean before opening in QGIS.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style:
 normal;"><span>Brent Wood<br></span></div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Luca Lanteri <mescal72@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Nico Alberti <n8@langhirano.it> <br><b><span style="font-weight: bold;">Cc:</span></b> qgis-user <qgis-user@lists.osgeo.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Sunday, March 30, 2014 9:06 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Qgis-user] Qgis slow in retrieving PGsql data.<br> </font> </div> <div class="y_msg_container"><br><div id="yiv7417055531"><div><div dir="ltr"><div><div><div><div>Which version of PostGIS are you using ?<br clear="none"></div><br
 clear="none"></div>You have to check to have at least select grants to the geometry_columns table (in postgis 1.5) or view (in postgis 2.0) in public schema.<br clear="none">
</div>If you can't access to this table qgis spends a lot of time in order to scan all geometries of all layer.<br clear="none"><br clear="none"></div><div>with PostGIS < 2.0 you also have to manually register you layer into the geometry_columns table</div>
<br clear="none">regards<br clear="none">Luca<br clear="none"><div><div><br clear="none"></div></div></div><div class="yiv7417055531gmail_extra"><br clear="none"><br clear="none"><div class="yiv7417055531gmail_quote">2014-03-28 13:38 GMT+01:00 Nico Alberti <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:n8@langhirano.it" target="_blank" href="mailto:n8@langhirano.it">n8@langhirano.it</a>></span>:<br clear="none">
<div class="yiv7417055531yqt6872057011" id="yiv7417055531yqt47201"><blockquote class="yiv7417055531gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi everybody. I am rather new to both technnologies (Qgis and PGsql data) so sorry if the question is lame. When I try to connect to a PGsql database, everything goes fine; layers are correctly listed and I can see their geometry type and primary keys. However the "add layer" [1] is disabled: on the lower left part of QGis there is a message saying that QGis is busy scanning the "the_geom" column, and this is taking a lot of time (there are several huge datasets in that db).<br clear="none">

<br clear="none">
After the scan is over, eventually I am not able to load most of the datasets. A message states they are invalid and cannot be loaded.<br clear="none">
<br clear="none">
I know I am not giving you a lot of hints. The errors are quite generic. However when I try to connect to another PGsql database (one that I can fully manage) everything goes fine. Could the dataset be corrupted in some strange way, could they lack something that forces QGis to scan the entire geometry data?<br clear="none">

<br clear="none">
Every suggestion would be greatly appreciated. Thank you in advance.<br clear="none">
<br clear="none">
[1] messages are in Italian, as you can guess. The actual English message is probably different.<span class="yiv7417055531HOEnZb"><font color="#888888"><br clear="none">
-- <br clear="none">
Ciao<br clear="none">
Nico<br clear="none">
______________________________<u></u>_________________<br clear="none">
Qgis-user mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:Qgis-user@lists.osgeo.org" target="_blank" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a><br clear="none">
</font></span></blockquote></div></div><br clear="none"></div></div></div><br><div class="yqt6872057011" id="yqt97529">_______________________________________________<br clear="none">Qgis-user mailing list<br clear="none"><a shape="rect" ymailto="mailto:Qgis-user@lists.osgeo.org" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br clear="none"><a shape="rect" href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></div><br><br></div> </div> </div>  </div></body></html>