Re: [Qgis-developer] pyqgis add postgres table

2015-02-23 Thread Bernhard Ströbl
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)

[Qgis-developer] pyqgis add postgres table

2015-02-23 Thread 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')