Pg-runtime-config » История » Версия 2
Андрей Волков, 2017-12-21 15:57
1 | 1 | Андрей Волков | h1. Изменеие параметров postgresql 9.4+ в runtime |
---|---|---|---|
2 | |||
3 | h2. На примере включения опций логгирования |
||
4 | |||
5 | h3. Включить: |
||
6 | |||
7 | <pre> |
||
8 | postgres=# ALTER SYSTEM SET log_duration = on; |
||
9 | ALTER SYSTEM |
||
10 | postgres=# ALTER SYSTEM SET log_connections = on; |
||
11 | ALTER SYSTEM |
||
12 | postgres=# ALTER SYSTEM SET log_disconnections = on; |
||
13 | ALTER SYSTEM |
||
14 | postgres=# ALTER SYSTEM SET log_statement = 'all'; |
||
15 | ALTER SYSTEM |
||
16 | postgres=# ALTER SYSTEM SET log_temp_files = 0; |
||
17 | ALTER SYSTEM |
||
18 | postgres=# SELECT pg_reload_conf(); |
||
19 | </pre> |
||
20 | |||
21 | 2 | Андрей Волков | h3. Отключить: |
22 | 1 | Андрей Волков | |
23 | <pre> |
||
24 | postgres=# ALTER SYSTEM RESET log_duration; |
||
25 | ALTER SYSTEM |
||
26 | postgres=# ALTER SYSTEM RESET log_connections; |
||
27 | ALTER SYSTEM |
||
28 | postgres=# ALTER SYSTEM RESET log_disconnections; |
||
29 | ALTER SYSTEM |
||
30 | postgres=# ALTER SYSTEM RESET log_statement; |
||
31 | ALTER SYSTEM |
||
32 | postgres=# ALTER SYSTEM RESET log_temp_files; |
||
33 | ALTER SYSTEM |
||
34 | postgres=# SELECT pg_reload_conf(); |
||
35 | </pre> |
||
36 | |||
37 | h2. Изменения сохраняются в postgresql.auto.conf |
||
38 | |||
39 | <pre> |
||
40 | # Do not edit this file manually! |
||
41 | # It will be overwritten by ALTER SYSTEM command. |
||
42 | log_duration = 'on' |
||
43 | log_connections = 'on' |
||
44 | log_disconnections = 'on' |
||
45 | log_statement = 'all' |
||
46 | log_temp_files = '0' |
||
47 | </pre> |