Re: Discarding DISCARD ALL - Mailing list pgsql-hackers

From James Coleman
Subject Re: Discarding DISCARD ALL
Date
Msg-id CAAaqYe_x4Xr5j+9mDFO+xSFzv=K9z6VpWiMFq2=qO7GFdZq=Pw@mail.gmail.com
Whole thread Raw
In response to Re: Discarding DISCARD ALL  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Discarding DISCARD ALL  (Simon Riggs <simon.riggs@enterprisedb.com>)
List pgsql-hackers
On Wed, Jan 20, 2021 at 9:58 AM Simon Riggs <simon@2ndquadrant.com> wrote:
>
> On Wed, 20 Jan 2021 at 14:21, James Coleman <jtc331@gmail.com> wrote:
>
> > An alternative approach that occurred to me while typing this reply: a
> > setting in Postgres that would disallow setting session level GUCs
> > (i.e., enforce `SET LOCAL` transaction level usage instead) would
> > remove a large chunk of our need to set server_reset_query_always=1
> > (and more interestingly it'd highlight when broken code gets pushed).
> > But even with that, I see some value in the proposed setting since
> > there is additional session state beyond GUCs.
>
> With transaction_cleanup=on we could force all SETs to be SET LOCAL.
>
> The point is that if we declare ahead of time that the transaction
> will be reset then we can act differently and more easily for various
> circumstances, for SETs, for Temp tables and others.

Right, I agree it's independently useful. My "alternative" is a subset
of that functionality and doesn't cover as many cases.

James



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: pg_stat_statements oddity with track = all
Next
From: Dmitry Dolgov
Date:
Subject: Re: [HACKERS] [PATCH] Generic type subscripting