Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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

pgsql-hackers by date

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

pgsql-bugs by date

Next:From: David BoeschDate: 2007-06-29 12:43:36
Subject: Re: BUG #3417: Foreign key constraint violation occursunexpectedly
Previous:From: Stephen FrostDate: 2007-06-29 02:28:04
Subject: Re: 'SET LOCAL ROLE blah;' doesn't work?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group