[pgpool-general: 9011] exemption of "postgres" default database from connection caching

Nathan Mehl n+pgpool at oden.io
Wed Jan 31 05:00:22 JST 2024


In the docs for the connection_cache parameter, it states that:
"connections to template0, template1, postgres and regression databases are
not cached even if connection_cache is on."

This behavior appears to date from commit 32a44be0e8 in 2015, which fixed a
client connection leak (
https://www.pgpool.net/pipermail/pgpool-general/2015-January/003438.html),
but looking at the mailing list archives there was not really any
discussion of whether it was appropriate to exempt the "postgres" database
from connection caching, and this behavior came as a bit of an unpleasant
surprise when I ran across it.

The Postgresql docs at
https://www.postgresql.org/docs/current/app-initdb.html state:

"The postgres database is a default database meant for use by users,
utilities and third party applications. template1 and template0 are meant
as source databases to be copied by later CREATE DATABASE commands."

It makes sense that the template databases would be treated specially here,
but I think a hardcoded exemption for the default user database is
non-intuitive and I'm curious to know what the reasoning was behind this
decision?

-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20240130/51119a90/attachment.htm>


More information about the pgpool-general mailing list