Hi Giuseppe ,<div><br></div><div>The author of provider told me about this problem, see ticket (<a href="https://trac.osgeo.org/qgis/ticket/3329">https://trac.osgeo.org/qgis/ticket/3329</a>).</div><div><br></div><div>The  geometries and SQL are  very simples.</div>
<div><br></div><div>My enviroment is:</div><div>1) Windows XP</div><div>2) OSGEO4W packages: QGIS 1.6 and Trunk</div><div>3) Postgres in Localhost</div><div>4) User for Postgres: postgres (administator).</div><div>5) SQL : </div>
<div><span class="Apple-style-span" style="font-family: Verdana, Arial, &#39;Bitstream Vera Sans&#39;, Helvetica, sans-serif; font-size: 13px; ">SELECT</span></div><div><span class="Apple-style-span" style="font-family: Verdana, Arial, &#39;Bitstream Vera Sans&#39;, Helvetica, sans-serif; font-size: 13px; ">  <a href="http://l.id">l.id</a> AS gid, l.the_geom AS the_geom</span></div>
<div><span class="Apple-style-span" style="font-family: Verdana, Arial, &#39;Bitstream Vera Sans&#39;, Helvetica, sans-serif; font-size: 13px; ">FROM gis.tl_20101117_101056_limite l</span></div><div><font class="Apple-style-span" face="Verdana, Arial, &#39;Bitstream Vera Sans&#39;, Helvetica, sans-serif"><br>
</font></div><div><font class="Apple-style-span" face="Verdana, Arial, &#39;Bitstream Vera Sans&#39;, Helvetica, sans-serif"><div>Please inform about your enviroment.</div><div>It  can be util for understand what is happened.</div>
<div><br></div><div>Regards,</div><div>Luiz Motta</div></font></div><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">2010/12/14 Giuseppe Sucameli <span dir="ltr">&lt;<a href="mailto:sucameli@faunalia.it">sucameli@faunalia.it</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Luiz,<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Tue, Dec 14, 2010 at 2:43 AM, Luiz Motta <span dir="ltr">&lt;<a href="mailto:motta.luiz@gmail.com" target="_blank">motta.luiz@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">



I am testing the &#39;Custom database query&#39; plugins, where, i use layers outside public&#39;s schema.<br>

The plugin create the layer, but, before, i receive the message error about cursor od database.<br>

If the layers are inside public&#39;s schema not appear message.<br>

The one ticket is open, number 3329.<br></blockquote></div></div><div>I&#39;m unable to reproduce it, both &#39;Custom database query&#39; and &#39;RT Sql Layer&#39; plugins <br>seems to work with tables not in the public schema.<br>


Maybe does your layer contain invalid geometries?<br><br>Cheers.<br>
<br></div></div>-- <br><font color="#888888">Giuseppe Sucameli<br><br>
</font></blockquote></div><br></div>