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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group