[Qgis-developer] Getting schema name of a PostGIS layer from python

Giuseppe Sucameli brush.tyler at gmail.com
Fri Sep 28 13:46:45 PDT 2012


Hi Sandro,

On Fri, Sep 28, 2012 at 10:25 PM, Sandro Santilli <strk at keybit.net> wrote:
> Is it possible for a python plugin to get from a QgsVectorLayer
> to the name of the schema containing it (if any) ?

depends if the schema was passed when creating the
uri string used to load the layer:

QgsDataSourceURI( vl.source() ).schema()

where vl is the vector layer.

If the passed schema was empty you will get an empty string.

Cheers.

> I'm spending this friday night on a proof-of-concept topology
> editing tool.
>
> --strk;
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
Giuseppe Sucameli


More information about the Qgis-developer mailing list