<html><head></head><body>Agreed, a long standing annoying issue. Thanks for taking it.<br>Cheers.<br><br><div class="gmail_quote">Il 4 febbraio 2019 23:32:39 CET, Nyall Dawson <nyall.dawson@gmail.com> ha scritto:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On Tue, 5 Feb 2019 at 05:54, Timothé Perez <timothe@pragma-innovation.fr> wrote:<br>><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Hello qgis-devs,<br><br> This is my first message here and first contribution to QGIS, so I thank you in advance for being indulgent and do not hesitate to correct me on any mistake I will make.<br> I didn't want to jump right into proposing my patch "as is" in a PR as I'm new to this project, so first I wanted to discuss about it to make sure I got it right.<br><br> Here's a recap of what I have found so far (sorry if it's a bit long):<br><br> I'm using QGIS 3.4 with a PostgreSQL database to store layers and I'm facing the same issue as described in <a href="https://issues.qgis.org/issues/20170">https://issues.qgis.org/issues/20170</a> : unrecoverable PostgreSQL connections.<br><br> I have cloned the repo and started to dig, as it is really annoying because it forces you to abandon your changes and close and reopen your project.<br></blockquote><br>Upfront, thanks for the great attitude. This is one of the MOST<br>effective ways to get bugs fixed... rolling up your sleeves and fixing<br>them yourself!<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> To reproduce the problem, the simplest way is to spin a local PostgreSQL database with postgis and create a table with just a serial and a geometry:<br>  CREATE TABLE foo (id serial primary key, geometry GEOMETRY(POINT, 4326));<br><br> Open it in QGIS, create several features, save them then simply restart the PostgreSQL service so that all connections are forced to be closed.<br> QGIS logs will display that the connections to PostgreSQL were lost but recovered and features will still be accessible.<br><br> However if I start editing the layer by adding a feature and then call save, it will fail:<br><br> 2019-02-04T19:11:30     CRITICAL    Layer foo : PostGIS error while adding features: FATAL: terminating connection due to administrator command<br>              la connexion au serveur a été coupée de façon inattendue<br>               Le serveur s'est peut-être arrêté anormalement avant ou durant le<br>               traitement de la requête.<br><br> 2019-02-04T19:11:30     WARNING    Commit errors : Could not commit changes to layer foo<br> 2019-02-04T19:11:34     CRITICAL    Layer foo : PostGIS error while adding features: no result buffer<br> 2019-02-04T19:11:34     WARNING    Commit errors : Could not commit changes to layer foo<br><br> My only option is to cancel my edits and reload the project to regain full access to the db.<br><br> So in fact this problem has 2 causes: (time to dig in the C++ code)<br><br></blockquote>*snip*<br>><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">I am willing to propose a PR if my fixes make sense and are acceptable, this will fix an annoying issue.<br></blockquote><br>They both sound reasonable to me, and yes, valuables fixes for an<br>annoying issues! Looking forward to the PRs! (One request: please file<br>these as two separate PRs, so both fixes can be discussed and reviewed<br>independently.)<br><br>Nyall<hr>QGIS-Developer mailing list<br>QGIS-Developer@lists.osgeo.org<br>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre></blockquote></div><br>-- <br>Sorry for being short</body></html>