Feature request #20953

Notify Signal from Postgres available

Added by Raul Sangonzalo over 5 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Data Provider/PostGIS
Pull Request or Patch supplied:No Resolution:
Easy fix?:Yes Copied to github as #:28772

Description

At the moment, a Notify signal can be caught in a layer from a Postgres database. It would be great if there was a free signal available (e.g not linked to a layer) to catch the Notify signal from the database (especially if working with Plugins)

A "LISTEN" SQL through psycopg2 in Python makes QGIS to eternally listen for this signal, blocking everything else and crashing eventually.

The only solution I've found so far is by creating a temporary layer which is updated through the python script and then using the signal "QgsMapLayer.repaintRequested".
Maybe a channel could be enabled within the project settings so we can access it through a signal?

Also available in: Atom PDF