May 2019
Intermediate to advanced
600 pages
20h 46m
English
Several of the parameters controlling logging are reserved for superusers.
If you want to allow some of your developers to set logging, 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 of the variables involved:
create ...
Read now
Unlock full access