<div dir="ltr">Hi Remi<div><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 12, 2015 at 11:27 PM, Rémi Cura <span dir="ltr"><<a href="mailto:remi.cura@gmail.com" target="_blank">remi.cura@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello dear list,<div><br></div><div>in  the process of developing a plugin (python 2.7, QGIS 2.6),</div><div><br></div><div>from pyqgis ,</div><div>we would like to refresh a Postgis layer.<br>When using the vectorLayer.refresh(), it does nothing.</div></div></blockquote><div><br></div><div>Try vectorLayer.triggerRepaint()</div><div><br></div><div>Calling refresh() of the canvas will not work because even though the canvas will get refreshed, it will use previously cached map images. With triggerRepaint() the cached map image of your layer will get cleared and also refresh() will be called for any canvas that displays such layer.</div><div><br></div><div>Regards</div><div>Martin</div><div><br></div></div></div></div>