Re: Discarding DISCARD ALL

Andreas Karlsson <andreas@proxel.se>

From: Andreas Karlsson <andreas@proxel.se>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-12-23T22:34:32Z
Lists: pgsql-hackers
On 12/23/20 6:49 PM, Simon Riggs wrote:
> The whole premise of the patch is tighter integration, with the server
> providing the facilities that poolers need.

I am all for that. Ideally I would want builtin connection pooling but 
short term I think the way forward is most likely tighter integration.

> The patch can be enhanced to do whatever else we agree is desirable.
> 
> Do we need something like DISCARD ALL EXCEPT PREPARED STATEMENTS;  ??
> 
> If there are different requirements for each pooler, what are they?

If someone adds prepared statement support to e.g. PgBouncer that might 
be a nice feature to have. Plus maybe something like "SET 
transaction_cleanup = 'except_prepared'". But right now I think the 
pools which support prepared statements do not use DISCARD ALL and 
instead just trust the end user to not run SET or use temporary tables 
which outlive transactions.

Andreas