May 2018
Intermediate to advanced
576 pages
30h 25m
English
Several of the parameters controlling logging are reserved for superusers.
If you want to allow some of your developers to set logging on, you can write a function for them to do exactly that:
create or replace function debugging_info_on() returns void security definer as $$ begin set client_min_messages to 'DEBUG1'; set log_min_messages to 'DEBUG1'; set log_error_verbosity to 'VERBOSE'; set log_min_duration_statement to 0; end; $$ language plpgsql; revoke all on function debugging_info_on() from public; grant execute on function debugging_info_on() to bob;
You may also want to have a function go back to the default logging state by assigning DEFAULT to all the variables involved:
create ...