Reputation: 6470
postgresql.config: log_min_duration_statement = -1
Client A:
SELECT set_config('log_min_duration_statement', '30000', false);
SELECT current_setting('log_min_duration_statement');
-----
30s
Client B:
SELECT current_setting('log_min_duration_statement');
-----
-1
The client B changes postgresql.config: log_min_duration_statement = 60000
select pg_reload_conf();
SELECT current_setting('log_min_duration_statement');
---
1 min
===
Ok, How the client A can reset his setting and use the current parameter value from the postgresql.config file without connection closing? I.e. the client A does
select pg_reload_conf();
but he still has a previously set 30s
Upvotes: 5
Views: 5662
Reputation: 51466
https://www.postgresql.org/docs/current/static/sql-reset.html
RESET — restore the value of a run-time parameter to the default value
just
reset log_min_duration_statement
also https://www.postgresql.org/docs/current/static/functions-admin.html
set_config
sets the parameter setting_name to new_value. If is_local is true, the new value will only apply to the current transaction. If you want the new value to apply for the current session, use false instead. The function corresponds to the SQL command SET.
In other words you don't need pg_reload_config()
- because you change setting on session level only. you need reload only after modifying ponstgres.conf
same link above:
pg_reload_conf()
Cause server processes to reload their configuration files
Upvotes: 3