2
votes
1answer
110 views

How to write a new layer to PostgreSQL from QGIS plugin

The PyQGIS cookbook states that QgsVectorFileWriter can write vector layers to any format supported by OGR: https://www.qgis.org/en/docs/pyqgis_developer_cookbook/vector.html#writing-vector-layers ...
0
votes
0answers
101 views

PyQGIS + PostGis: FATAL: sorry, too many clients already

I searched for questions regarding this problem and hadn't find one. I'm developing a custom application with a map canvas to show some geographic information from a PostGis database. After some ...
2
votes
1answer
62 views

How to properly establish a PostgreSQL connection using QgsCredentials

I'm trying to establish a Postgres connection using QgsCredentials as described here: How to access user credentials in database connection? The only problem is that I cannot establish a working ...
1
vote
2answers
511 views

How to perform SQL queries and get results from QGIS python console?

I'm writing a python script using QGIS API. I have to get results from postgres database table. The table has geometry field and other non-geometry fields. I want to perform SQL queries on ...
1
vote
0answers
191 views

How to load the default layer style from Postgresql with Python?

I would like to write a python macro that upon opening my QGIS project file will reload the default style for each layer from the postgres 'layer_style' table. I have had a look at the documentation ...
1
vote
0answers
255 views

Qgis Plugin development with postgres data

can someone help me with initial developing on qgis plugin that displays postgres data table on a QTTableView or QTTableWidget? So far: I can connect to database using psycopg2 or using ...