blob: 743c0b63aa33c00584391d612dff142fc295c071 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
## How to reload config changes during the runtime (SIGHUP)?
```
select pg_reload_conf();
```
## Does changing a config setting require a restart of postgresql or just a reload (SIGHUP)?
This can be archived by simply selecting the setting from pg_settings.
```
select context from pg_settings where name='max_wal_size';
```
## Is a restart of postgresql required?
```
select pending_restart from pg_settings where name='max_wal_size';
```
This will tell you if a restart is pending for a setting.
## How to check configuration (postgresql.conf) for configuration errors
```
select sourcefile, name,sourceline,error from pg_file_settings where error is not null;
```
## How to check pg_hba.conf for configuration errors
```
select pg_hba_file_rules();
```
## Check vacuuming and autovacuuming date for tables per database
Switch to the desired database and then you run this query to see the vaccum status.
```
SELECT
schemaname,
relname,
last_vacuum,
last_autovacuum,
n_dead_tup
FROM
pg_stat_all_tables
WHERE
schemaname NOT IN ('pg_catalog', 'information_schema')
ORDER BY
n_dead_tup DESC;
```
|