[QGIS-Developer] QGIS freezes when saving table with AFTER INSERT or UPDATE

Alexandre Neto senhor.neto at gmail.com
Thu Jan 4 02:16:00 PST 2024


Sorry for the cross posting.

I have a table with the following trigger

CREATE TRIGGER tr_base_cont_trocos_ai AFTER
INSERT OR UPDATE ON base.cont_troco
FOR EACH STATEMENT
EXECUTE FUNCTION tr_gerar_outputs();

Now, the tr_gerar_outputs() takes some time to process, as it generates new tables and updates a few materialized views.

In QGIS, when I add or update one or more features and press save, I would expect it to be immediate, but it seems that QGIS hangs waiting for the function to finish before considering the save operation complete. If the function fails, it even prevent the feature to be commit.

Is this expected for a AFTER INSERT OR UPDATE trigger? Shouldn't PostgreSQL commit the changes, inform QGIS that the operation was successful and only then execute the trigger?

Thanks,

Alexandre Neto

Sent with Shortwave <https://www.shortwave.com?utm_medium=email&utm_content=signature&utm_source=c2VuaG9yLm5ldG9AZ21haWwuY29t>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240104/24231f4e/attachment.htm>


More information about the QGIS-Developer mailing list