It was an encoding problem with the parameters I passed to the URI. It works fine now.<div><br></div><div>giovanni<br><br><div class="gmail_quote">2012/12/3 G. Allegri <span dir="ltr"><<a href="mailto:giohappy@gmail.com" target="_blank">giohappy@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm setting the URI of a PostGIS view layer in the following way:<div><br></div><div>> uri.setDataSource(schema,table,geom_column,'',key_column)</div>
<div><br></div><div>but the resulting layer has something wrong, eg layer.isValid() returns False, and I can't load it.</div>
<div>I can load the same view through the GUI, settings the Primary Key Column manually.</div><div>What's wrong with the way I'm using setDataSource?</div><div><br></div><div>giovanni</div><div><br></div>
</blockquote></div><br></div>