Re: 'SET LOCAL ROLE blah;' doesn't work?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: 'SET LOCAL ROLE blah;' doesn't work?
Date: 2007-06-29 02:49:20
Message-ID: 3368.1183085360@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David Boesch 2007-06-29 12:43:36 Re: BUG #3417: Foreign key constraint violation occurs unexpectedly
Previous Message Stephen Frost 2007-06-29 02:28:04 Re: 'SET LOCAL ROLE blah;' doesn't work?

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-06-29 02:52:31 Re: AutoVacuum Behaviour Question
Previous Message Bruce Momjian 2007-06-29 02:41:14 Re: write past chunk end in ExprContext / to_char