Bug report #8852

QGIS crashes when having a Querylayer referencing deleted or invalid postgres table

Added by Remi Cura about 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:High
Assignee:Martin Dobias
Category:-
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

Description

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.

Associated revisions

Revision f15c8869
Added by Martin Dobias almost 6 years ago

Fix #8852 (crash when removing invalid postgres table from project)

History

#1 Updated by Giovanni Manghi about 6 years ago

  • Status changed from Open to Feedback

similar/duplicate of #8150 ?

#2 Updated by Remi Cura about 6 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 ?

#3 Updated by Giovanni Manghi about 6 years ago

  • Status changed from Feedback to Open

Remi Cura wrote:

hey I think you are mistaken :

I just asked

#4 Updated by Remi Cura about 6 years ago

Additonal info :
this bug is also present when using the classical "add postgis layer", not only when usign the DBManager.

#5 Updated by Giovanni Manghi about 6 years ago

  • Priority changed from Normal to High
  • Category deleted (DB Manager)

#6 Updated by Remi Cura about 6 years ago

Hm as far as I can tell,
it also happens on my ubuntu 12.04 hosted on a virtual Machine.

Cheers,

Rémi-C

#7 Updated by Giovanni Manghi about 6 years ago

  • Operating System deleted (XP)
  • OS version deleted (SP3)

#8 Updated by Martin Dobias almost 6 years ago

  • Assignee set to Martin Dobias

#9 Updated by Martin Dobias almost 6 years ago

  • Status changed from Open to Closed

#10 Updated by Martin Dobias almost 6 years ago

  • Target version set to Version 2.2

Also available in: Atom PDF