<div dir="ltr">Hi, Stephen,<div><br></div><div>We are using <span style="color:rgb(32,31,30);font-size:15px">PostgreSQL </span><span class="gmail-mark87kg3q57o" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:15px;line-height:inherit;vertical-align:baseline;color:rgb(32,31,30)">version</span><span style="color:rgb(32,31,30);font-size:15px"> 10.10 and </span><span class="gmail-marknblyyhaud" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:15px;line-height:inherit;vertical-align:baseline;color:rgb(32,31,30)">postgis</span><span style="color:rgb(32,31,30);font-size:15px"> </span><span class="gmail-mark87kg3q57o" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:15px;line-height:inherit;vertical-align:baseline;color:rgb(32,31,30)">version</span><span style="color:rgb(32,31,30);font-size:15px"> 2.4.8.</span></div><div><span style="color:rgb(32,31,30);font-size:15px"><br></span></div><div><span style="color:rgb(32,31,30);font-size:15px">Are these Linux commands --- </span> "df -h" and watch the process with "top"?</div><div><br></div><div>Regards,</div><div><br></div><div>Shao</div><div><span style="color:rgb(32,31,30);font-size:15px"><br></span></div><div><span style="color:rgb(32,31,30);font-size:15px"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 14 Jan 2020 at 01:23, Stephen Woodbridge <<a href="mailto:stephenwoodbridge37@gmail.com">stephenwoodbridge37@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 1/13/2020 5:28 PM, Shaozhong SHI wrote:<br>
> Psql may carry out large queries on big data sets.  These operations <br>
> may take a long time to complete.  It occurs that psql loses <br>
> connection to the database.<br>
><br>
> When a do loop is created to limit queries to range of rows at a time, <br>
> engagement between psql and postures can be maintained.  However, this <br>
> could take a long time.<br>
><br>
> Disconnection between psql and posters is understood due to timeout.<br>
<br>
I am not aware of any timeouts between psql and the database. I have in <br>
fact run queries in the past that have run for 5-6 days. It is more <br>
likely that the query died because it ran out of memory, or disk space. <br>
You can monitor disk space with "df -h" and watch the process with "top" <br>
commands. If your query calls a plpgsql function that does a lot of <br>
looping be aware that these runs in a transaction and that long running <br>
transactions on logs of rows can eat up a lot of disk space. I have <br>
gotten around the problem by writing a perl/python/php/whatever script <br>
that runs the looping and make multiple smaller queries to the <br>
database.  In the newer versions of postgresql 10,11, 12 not sure which, <br>
I think you can now do begin and commit in plpgsql script to close out <br>
transactions but I'm not sure whether the that is just for <br>
sub-transactions or if the plpgsql function may still run as a transaction.<br>
<br>
What version postgresql and postgis are you running?<br>
<br>
I'm not sure I can help more than this other than to say I'm not aware <br>
of any 'keep alive' thing for this or that that is the real problem you <br>
are facing.<br>
<br>
-Steve<br>
<br>
><br>
> Is there a way to create a 'keep life script'?<br>
><br>
> Regards,<br>
> Shao<br>
><br>
> On Monday, 13 January 2020, Stephen Woodbridge <br>
> <<a href="mailto:stephenwoodbridge37@gmail.com" target="_blank">stephenwoodbridge37@gmail.com</a> <mailto:<a href="mailto:stephenwoodbridge37@gmail.com" target="_blank">stephenwoodbridge37@gmail.com</a>>> <br>
> wrote:<br>
><br>
>     On 1/13/2020 6:10 AM, Shaozhong SHI wrote:<br>
><br>
>         With long running processes, time-out could be an issue.<br>
><br>
>         Has anyone got experience in creating a "Keep alive script"<br>
>         solution to share?<br>
><br>
><br>
>     Need more information.<br>
>     What is timing out? ssh, php, psql, etc?<br>
><br>
>     _______________________________________________<br>
>     postgis-users mailing list<br>
>     <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a> <mailto:<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>><br>
>     <a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
>     <<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a>><br>
><br>
><br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div>