Re: PostgreSQL ping/pong to client

2019-04-19 Thread Peter J. Holzer
On 2019-04-17 18:41:57 +0200, Francisco Olarte wrote: > On Wed, Apr 17, 2019 at 4:49 PM Ajay Pratap > wrote: > > Correction: I meant when my java application dies postgres should break all > > the connections that were associated with that peer. > > And how is the server supposed to detect that

Re: PostgreSQL ping/pong to client

2019-04-18 Thread Tom Lane
Ajay Pratap writes: > Enabling system wise timeouts can impact my whole setup including my web > app, thats why it is hard for me to configure them. Uh ... who said anything about system-wide timeouts? The normal way to set this up is to configure the tcp_keepalives_xxx PG parameters, which will

Re: PostgreSQL ping/pong to client

2019-04-18 Thread Ajay Pratap
Maybe postgresql (application) layer ping pong. Enabling system wise timeouts can impact my whole setup including my web app, thats why it is hard for me to configure them. On Wed, Apr 17, 2019, 22:12 Francisco Olarte wrote: > On Wed, Apr 17, 2019 at 4:49 PM Ajay Pratap > wrote: > > Correction

Re: PostgreSQL ping/pong to client

2019-04-17 Thread Tom Lane
Francisco Olarte writes: > On Wed, Apr 17, 2019 at 4:49 PM Ajay Pratap > wrote: >> Correction: I meant when my java application dies postgres should break all >> the connections that were associated with that peer. > And how is the server supposed to detect that without keepalives? TCP > is de

Re: PostgreSQL ping/pong to client

2019-04-17 Thread Francisco Olarte
On Wed, Apr 17, 2019 at 4:49 PM Ajay Pratap wrote: > Correction: I meant when my java application dies postgres should break all > the connections that were associated with that peer. And how is the server supposed to detect that without keepalives? TCP is dessigned to survice for extended perio

Re: PostgreSQL ping/pong to client

2019-04-17 Thread Ajay Pratap
Correction: I meant when my java application dies postgres should break all the connections that were associated with that peer. On Wed, Apr 17, 2019, 19:59 Adrian Klaver wrote: > On 4/17/19 5:39 AM, Ajay Pratap wrote: > > Hello there, > > I am using PostgreSQL 10.7 as the database, and have Ja

Re: PostgreSQL ping/pong to client

2019-04-17 Thread Tom Lane
Adrian Klaver writes: > On 4/17/19 5:39 AM, Ajay Pratap wrote: >> I am using PostgreSQL 10.7 as the database, and have Java web app. My >> app takes a lock on the database using the following command whenever my >> server is starting. >> /select /pg_try_advisory_lock/(100)/ >> To make sure only

Re: PostgreSQL ping/pong to client

2019-04-17 Thread Adrian Klaver
On 4/17/19 5:39 AM, Ajay Pratap wrote: Hello there, I am using PostgreSQL 10.7 as the database, and have Java web app. My app takes a lock on the database using the following command whenever my server is starting. /select /pg_try_advisory_lock/(100)/ To make sure only one instance of the App