* 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