Bug report #8852
QGIS crashes when having a Querylayer referencing deleted or invalid postgres table
|Affected QGIS version:||2.0.1||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||17534|
When using QGIS 2.0 with a postgres 9.3 server :
adding some layer with the DB Manager via the sql windows (the qgis add layer is not properly working anyway, other subject),
layer is added to map and display is right (good).
If table is deleted or changed (columns names, etc),
the added layer gets empty (good).
Then when trying to delete this layer, qgis crashes (bad).
If re-loading the project, wrong layer gets eliminated at loading (good).
Bug is 100% reproducible, and is pretty severe as it crashes qgis without saving.
I can give more details, but unfortunately no access to my postgres server.
#2 Updated by Remi Cura about 7 years ago
hey I think you are mistaking :
The other issue is another one, very limitating, that is that DB manager locks (postgres meaning) table which are used in SQL query.
obviously it should not be the case.
So when trying to access a table that is used by another user/process : qgis freeze until it has access.
The transaction involved seems also to be flacky : according to pgadmin server status, qgis open a lot of transaction with server but doesn't always close it.
EDIT : actually I'm not sure what type of lock it is, as a true lock would prevent to drop the table, and I do drop table very often
EDIT 2 : oops, sorry. My bad
Giovanni Manghi wrote:
similar/duplicate of #8150 ?