Re: Per-function GUC settings: trickier than it looked

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Michael Paesold" <mpaesold(at)gmx(dot)at>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Per-function GUC settings: trickier than it looked
Date: 2007-09-04 20:11:57
Message-ID: 37ed240d0709041311i6d84e8fdg9847fa4b4b5391d1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/5/07, Michael Paesold <mpaesold(at)gmx(dot)at> wrote:
> Tom Lane wrote:
> > Basically my perspective on SET LOCAL is that its current behavior is a
> > bug, and even though it's been that way for a couple major releases now,
> > it's still something we oughta fix while we are busy whacking that part
> > of the code around. Florian's example with SET TRANSACTION READ ONLY
> > proves that it's a bug --- RELEASE is not defined to change any
> > transaction modes.
>
> Yeah, I think your original proposal was really sound. I would not
> expect the current SET LOCAL behaviour in the context of savepoints.
> If we really need the current behaviour, we should find a new name for
> this lasts-until-savepoint-release-or-transaction-end thingy.

So, if I read you correctly, in summary we'd like to:

* make SET LOCAL local to the transaction (i.e., make it behave as documented),
* abandon the idea of a subtransaction-local SET, because the new
function-local SET takes care of the interesting use-cases for that,
* somehow deal with the incompatibility with the 8.2 "security
definer" workaround.

Tom's proposal to handle the latter was that when a function-local SET
reverts, it overrides any inner SET LOCALs.

Am I on the right page?

Cheers,
BJ

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Huxton 2007-09-04 20:22:45 Re: Has anyone tried out the PL/pgSQL debugger?
Previous Message Andrew Dunstan 2007-09-04 19:55:30 Re: pg_dump and insert multi-rows option