try:
uri.setDataSource('public', 'persones', None, '', 'id')

Bernhard

Am 23.02.2015 16:18, schrieb Alexandre Busquets:
Hi,

I can't add non geometry tables from postgres with pyqgis, this is my code

     uri = QgsDataSourceURI()
     uri.setConnection(bd_host, bd_port, bd_db, bd_user, bd_pass)
     uri.setDataSource('public', 'persones', '', '', 'id')
     taula = QgsVectorLayer(uri.uri(), 'persones', 'postgres')
     print taula.isValid()


What is the problem?


Thanks





__________ Information from ESET Mail Security, version of virus signature 
database 11219 (20150223) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to