Bug report #21324
qgis freezes when adding a postgres table that any other question is selecting from
|Affected QGIS version:||3.4.4||Regression?:||No|
|Operating System:||Windows x64||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||up/downstream|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||29142|
I have rather big tables which I access with python scrips, pgadmin and QGIS, which works fairly well if I do it separably.
The problem occurs when I in pgadmin (or via Python and psycopg2) tries to execute a complex question that takes times and in the same time tries to add the table in QGIS. I can add other tables from the database, I can write question to the table (and get result) in the DB Manager etc. but QGIS appears to freeze when I add the table that involved in the question until the question is ready (or I cancel it) at that second is the layer stated to be loaded in QGIS.
The question which "takes time" is as simple as `select * from table_1 where st_intersects(column, st_geomfromtext('wktstring'))` and takes some time just since it is 100 million rows +
#1 Updated by Nyall Dawson over 1 year ago
- Resolution set to up/downstream
- Status changed from Open to Closed
This isn't a QGIS issue - you'll see the same behaviour if you open two instances of pgadmin and try the select in a second instance whilst a locking operation is underway in the first instance. You may have some luck by tweaking the db connection settings on the pg server to allow more simultaneous connections.