Use client_addr and client_port from pg_stat_activity to identify the application. The client_addr will give the host it’s connecting from and the port will allow you to determine the process on the client host.
I meant to say TCP/IP keep alive. There are different ways and options to set keep alive and some are OS dependent. Here’ s an article that should help you get started: |