Re: 'SET LOCAL ROLE blah;' doesn't work? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: 'SET LOCAL ROLE blah;' doesn't work?
Date
Msg-id 3368.1183085360@sss.pgh.pa.us
Whole thread Raw
In response to Re: 'SET LOCAL ROLE blah;' doesn't work?  (Stephen Frost <sfrost@snowman.net>)
List pgsql-bugs
Stephen Frost <sfrost@snowman.net> writes:
>> So actually, ON_ERROR_ROLLBACK breaks *any* use of SET LOCAL, not just
>> ROLE.  Not sure that this is fixable :-(

> That's not the behavior which is intended though, is it?  SET LOCAL
> should be for an entire transaction, not for subtransactions/savepoints.

No, it's supposed to be per subtransaction.  Or at least that's the
interpretation we put on it when we made subtransactions; I fear it's
too late to change that now, even if there were a good argument to.

> Additionally, as I mentioned before, we should really make it clear that
> 'reset all' doesn't apply to roles.  The reason I bring it up is that,
> in at least the PG PHP driver, when using persistant connections it's
> expected that a 'reset all' handles cleaning things up entirely between
> page loads, and that's not the case for roles.

That assumption is broken anyway.  As of 8.3 there's a DISCARD ALL
command that actually does a full cleanup of connection-local state.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Stephen Frost
Date:
Subject: Re: 'SET LOCAL ROLE blah;' doesn't work?
Next
From: David Boesch
Date:
Subject: Re: BUG #3417: Foreign key constraint violation occurs unexpectedly