5

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

1
  • just reset log_min_duration_statement Commented Jan 27, 2018 at 9:30

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.