<html><body><div><div><span>Sorry for the cross posting.</span></div><br><div><span>I have a table with the following trigger</span></div><br><div><b><span>CREATE</span></b><span> </span><b><span>TRIGGER</span></b><span> tr_base_cont_trocos_ai </span><b><span>AFTER</span></b></div><div><b><span>INSERT</span></b><span> </span><b><span>OR</span></b><span> </span><b><span>UPDATE</span></b><span> </span><b><span>ON</span></b><span> base.cont_troco</span></div><div><b><span>FOR</span></b><span> </span><b><span>EACH</span></b><span> </span><b><span>STATEMENT</span></b></div><div><b><span>EXECUTE</span></b><span> </span><b><span>FUNCTION</span></b><span> tr_gerar_outputs();</span></div><br><div><span>Now, the tr_gerar_outputs() takes some time to process, as it generates new tables and updates a few materialized views.</span></div><br><div><span>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.</span></div><br><div><span>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?</span></div><br><div><span>Thanks,</span></div><br><div><span>Alexandre Neto</span></div></div><br><div class="shortwave-signature"><div>
 Sent with <a href="https://www.shortwave.com?utm_medium=email&utm_content=signature&utm_source=c2VuaG9yLm5ldG9AZ21haWwuY29t" target="_blank" rel="noopener" style="color:#4C8AFF">Shortwave</a>
</div></div></body></html>