ALTER USER SET log_* not allowed...

Sean Chittenden <sean@chittenden.org>

From: Sean Chittenden <sean@chittenden.org>
To: PGBugs List <pgsql-bugs@postgresql.org>
Date: 2004-11-09T08:23:52Z
Lists: pgsql-bugs
I've got a particular database account that connects/disconnects 
hundreds of times a second, literally (email delivery agent).  Being 
the ever ready logger that I am, I have a number of logging bits turned 
on to help me identify problems when they come up.  In this case, I'm 
not worried about a problem and want to turn off most logging for this 
particular user.  I can issue an ALTER USER [usr] SET log_* = 
false/none in all cases, except for log_duration.

db=# ALTER USER dbmail SET log_disconnections = false;
ERROR:  parameter "log_disconnections" cannot be set after connection 
start

:-/  I use disconnections as the way of noting the number of 
connections.  Regardless, I think I'm off to the races... BUT! not 
quite:

INFO:  permission denied to set parameter "log_statement"
HINT:  Must be superuser to increase this value.
INFO:  permission denied to set parameter "log_duration"
HINT:  Must be superuser to change this value to false.

doh!  So much for that idea.  There's no real way to have some 
useconfig variables run by the super user and some run by the session 
user.  My workaround is to have the program call a SECURITY DEFINER 
function, but I'd be nice to be able to remove that hack.  Anyway, 
something to consider next time the system catalogs are being tweaked.  
-sc

-- 
Sean Chittenden