I am writing my own connection pool for libpq's connection.
My goal is to try to reduce the amount of time spent in opening and closing socket. However, I see that Postgres would close my connection after every so often.
What is the best solution for that? Should I regularly send some "Select 1" to keep the connection alive or is there a better way to write a connection pool for libpq?
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.