Hi Pablo, <br><br><div class="gmail_quote">On Wed, Feb 16, 2011 at 7:01 PM, Pablo Carreira <span dir="ltr"><<a href="mailto:pablotcarreira@hotmail.com">pablotcarreira@hotmail.com</a>></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;">





<div>
<div style="font-family: Tahoma; font-size: 10pt;"></div><div><font size="2" face="Tahoma">I'm trying to change the datasource of a postgis layer created with RT SQL, I mean, I want to make changes in the query after the layer is created. </font></div>

</div></blockquote><div>the provider stores internally the datasource URI value when created and<br>opens a connection to the database, so changing that value after  doesn't <br>affect the existent connection.<br><br>

BTW, why would you change that value after  the layer is created?<br>If you have a valid reason or you think this should be the right behavior, <br>file a ticket on trac.<br><br>Cheers.<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div><div style="font-family: Tahoma; font-size: 10pt;"><br></div><div>I tried this:</div><div><div style="margin: 0px; background-color: transparent;"><span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br>

</span></div><div style="margin: 0px; background-color: transparent;"><span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">l=qgis.utils.iface.activeLayer()</span><br>

<span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">d=l.dataProvider()</span></div>

</div><div style="margin: 0px; background-color: transparent;"><span style="color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline;"><div style="margin: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: 12pt;">

<span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">d.setDataSourceUri(</span><span style="font-family: Arial; font-size: 15px; white-space: pre-wrap;">u'dbname=\'postgis\' host.......')  </span></div>

<div style="margin: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: 12pt;"><span style="font-family: Arial; font-size: 15px; white-space: pre-wrap;">l.reload()</span></div>

<div style="margin: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: 12pt;"><span style="font-family: Arial; font-size: 15px; white-space: pre-wrap;"><br></span></div>

<div style="margin: 0px; background-color: transparent;"><span style="font-family: Arial; font-size: 15px; white-space: pre-wrap;">It's ok, but nothing happens.</span></div><div style="margin: 0px; background-color: transparent;">

<span style="font-family: Arial; font-size: 15px; white-space: pre-wrap;">Am I in the right path? What am I missing?</span></div></span></div><div style="margin: 0px; background-color: transparent;"><font face="Arial"><span style="font-size: 15px; white-space: pre-wrap;"><br>

</span></font></div><br><font size="2" face="Tahoma">Pablo Torres Carreira
</font><br><br>                                         </div>
<br>_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Giuseppe Sucameli<br><br>