qwat / pg-history-viewer

QGIS plugin that helps visualize contents of a PostgreSQL audit trigger table
16 stars 7 forks source link

The plugin never closes their cursor to the db, blocking some tables #28

Open autra opened 3 years ago

autra commented 3 years ago

Description

The plugin never calls cur.close() after making their query

Step to reproduce

expected: the operation succeeds

actual: the operation is blocked by a lock, even though the plugin is not doing anything. One needs to close qgis (or reload the plugin with plugin reloader) to be able to drop the audit schema.

This is a hassle in dev mode for this drop, but other stuff might be locked that could disturbing day-to-day usage of the db.

Proposed solution

Close the cursor once it's not needed any more.