Hi all, i have a qgis vector layer with postgis data. Qgis connects to the data via a complex view. The view contains a run-time parameter which must be set by the postgresql statement “SET parameter=value;” Postgres SET command only affects the value used by the current session so I have to use the same db connection used by the vector layer. I am writing a python plugin but I can’t find a way to get the db connection used by the layer (QgsDataProvider don’t provide a method to obtain the db connection) Note that I don’t want to create another db connection to the same db (because it’d be another db session). How can I get the same db connection used by the vector layer and run an sql statement ?
Thanks Roberto ________________________________ Per essere informati sulle novità del Gruppo Iren, vi invitiamo a registrarvi alla nostra mailing list, all’indirizzo "http://www.gruppoiren.it/"<http://www.gruppoiren.it/> . È possibile, inoltre, avanzare nuove idee e progetti per il territorio e seguire quelli già attivi nei Comitati Territoriali del Gruppo Iren, consultando "http://www.Irencollabora.it"<http://www.Irencollabora.it> You can also suggest new ideas and initiatives for the territory and view those already active in the Iren Group Territorial Committees "http://www.Irencollabora.it"<http://www.Irencollabora.it> Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque, destinate esclusivamente alle persone o alla Società sopraindicati. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p. , che ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di informare immediatamente il mittente.
_______________________________________________ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer