There already are solutions regarding this feature in Postgres using "connection pooler" wording
see
pgpool: http://www.pgpool.net/mediawiki/index.php/Main_Page
pgbouncer: https://pgbouncer.github.io/
there are also discussions to include this as a core feature
https://www.postgresql.org/message-id/flat/4b971a8f-ff61-40eb-8f30-7b57eb0fdf9d%40postgrespro.ru
--Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html