[Qgis-developer] Python: change query of PostGIS layer

Martin Dobias wonder.sk at gmail.com
Wed May 2 14:11:10 PDT 2012

On Mon, Apr 30, 2012 at 1:10 PM, Bernhard Ströbl
<bernhard.stroebl at jena.de> wrote:
> Hi list,
> I am trying to change the query of an already loaded PostGIS layer from
> within a plugin. Same as if I right-clicked on the layer, chose "Query..."
> and entered a WHERE clause there.

That should be as simple as:
>>> vlayer.setSubsetString("category = 3")


More information about the Qgis-developer mailing list