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

From Stephen Frost
Subject Re: 'SET LOCAL ROLE blah;' doesn't work?
Date
Msg-id 20070628211037.GP7531@tamriel.snowman.net
Whole thread Raw
In response to Re: 'SET LOCAL ROLE blah;' doesn't work?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: 'SET LOCAL ROLE blah;' doesn't work?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> writes:
> >   At http://www.postgresql.org/docs/8.2/static/sql-set-role.html, we
> >   claim that 'SESSION and LOCAL modifiers act the same as for the
> >   regular SET command', but I don't think that's actually right...
>=20
> I cannot duplicate the behavior you show, in either HEAD or 8.2.
> Are you *sure* you were inside a transaction block?

Wow.  Okay, this is more interesting.  It has some interaction with:
\set ON_ERROR_ROLLBACK 'on'
in my .psqlrc.  If I remove that, then it works as expected.  My
understanding of ON_ERROR_ROLLBACK is that it'll set a savepoint before
each command and then will roll back to that savepoint on an error- but
it's still all inside of one main transaction.  Seems like
ON_ERROR_ROLLBACK is rolling back on a non-error in this case..  Strikes
me as very bizarre.

Try setting ON_ERROR_ROLLBACK to 'on' and doing 'set local role'...
This is on 8.2.4.

    Thanks,

        Stephen

pgsql-bugs by date:

Previous
From: Arpi
Date:
Subject: Re: BUG #3034: FATAL: could not open lock file "/tmp/.s.PGSQL.5432.lock": Permission denied
Next
From: Tom Lane
Date:
Subject: Re: 'SET LOCAL ROLE blah;' doesn't work?