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)
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')