<div dir="ltr"><div dir="ltr">On Mon, Feb 12, 2024 at 5:39 AM Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
If my memory is correct, the reasoning behind this is that postgres<br>
database is used by some critical tools including createdb, vacuumdb<br>
(and perhaps pgAdmin) by default as a connecting database (not a<br>
template database). In theory, pgpool resets connection property using<br>
DISCARD ALL and caching the connection to postgres database should be<br>
safe. BUT:<br>
<br>
1) These tools may not assume that the connection to database is<br>
reused.<br>
<br>
2) Pgpool admin could change configuration to not use DISCARD ALL in<br>
reset_query_list. In this case, those tools may or may not be<br>
confused because previous connection property still remains.<br>
<br>
3) Some tools may use custom options. The custom option cannot be<br>
removed by DISCARD ALL. In my understanding, it remains until the<br>
session ends. This may or may not cause trouble in cached<br>
connections. Probably this is not a problem for ordinary user<br>
databases (I never heard complains in the wild). But I am sure<br>
about postgres database.<br>
<br>
By these reasons I hesitate to make postgres database to be cached.<br>
Maybe we could add new option to allow postgres database to be cached<br>
in the future?<br></blockquote><div><br></div><div>This makes sense, it's just very much not our use case -- we primarily use postgres inside a cloud provider (Google CloudSQL) and manage table creation with migration tools executing sql directly.<br></div><div><br></div><div>Ideally, the list of databases to disable connection caching for would be configurable in the same way that the reset query list is, e.g.:</div><div><br></div><div> backend_disable_connection_caching_databases0 = 'postgres;template0;template1;regression'</div><div><br></div><div>-n</div></div></div>