> > 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.
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных