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:06:09
Message-ID: 2925.1183082769@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:
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
>> I cannot duplicate the behavior you show, in either HEAD or 8.2.

> 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.

Ah. log_statement = all tells the tale:

regression=# set log_statement='all';
SET
regression=# \set ON_ERROR_ROLLBACK 'on'
regression=# begin;
BEGIN
regression=# set local role tgl;
SET
regression=# show role;
role
------
none
(1 row)

regression=#

and the postmaster log has

2007-06-28 22:02:14.418 EDT 2870 LOG: statement: begin;
2007-06-28 22:02:26.044 EDT 2870 LOG: statement: SAVEPOINT pg_psql_temporary_savepoint
2007-06-28 22:02:26.045 EDT 2870 LOG: statement: set local role tgl;
2007-06-28 22:02:26.047 EDT 2870 LOG: statement: RELEASE pg_psql_temporary_savepoint
2007-06-28 22:02:57.545 EDT 2870 LOG: statement: SAVEPOINT pg_psql_temporary_savepoint
2007-06-28 22:02:57.546 EDT 2870 LOG: statement: show role;
2007-06-28 22:02:57.548 EDT 2870 LOG: statement: RELEASE pg_psql_temporary_savepoint

So actually, ON_ERROR_ROLLBACK breaks *any* use of SET LOCAL, not just
ROLE. Not sure that this is fixable :-(

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2007-06-29 02:14:01 Re: 'SET LOCAL ROLE blah;' doesn't work?
Previous Message Stephen Frost 2007-06-28 21:10:37 Re: 'SET LOCAL ROLE blah;' doesn't work?

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-06-29 02:14:01 Re: 'SET LOCAL ROLE blah;' doesn't work?
Previous Message Alvaro Herrera 2007-06-29 01:31:57 Re: lazy vacuum sleeps with exclusive lock on table