On Wed, May 9, 2018 at 1:58 AM, Craig Ringer <cr...@2ndquadrant.com> wrote:
> > > > It would be much more convenient to just set the environment variable > when > > running the script and let it affect the whole process and its children. > > > > Would a patch be welcome? > > I can't really comment on that part, but: > > PGOPTIONS="-c tcp_keepalives_count=5 -c tcp_keepalives_interval=60" > psql 'host=localhost' > > should enable server-side keepalives. Unsure how much that helps you > if you need client-side keepalives too. > Good point, in our specific case it appears to work as well if it's the server who sends the keepalives. Thank you, -- Alex