如何重新加载 PostgreSQL 配置

How to reload PostgreSQL configuration

我正在尝试在 PostgreSQL 中启用事务日志,其中查询 运行 时间超过 3 秒,方法是设置此标志

log_min_duration_statement = 3000

如何在不重启 Postgres 的情况下重新加载配置文件?

我尝试了以下选项并遇到了这些错误

1) postgres=# select pg_reload_config();
**ERROR:  function pg_reload_config() does not exist**
LINE 1: select pg_reload_config();
2) postgres@ospostgresql:/$ /usr/lib/postgresql/11/bin/pg_ctl reload
pg_ctl: no database directory specified and environment variable PGDATA unset
Try "pg_ctl --help" for more information.

感谢 a_horse_with_no_name 帮助找出导致问题 1 的拼写错误

1) postgres=# select pg_reload_config();
**ERROR:  function pg_reload_config() does not exist**
**-->** This is resolved by giving correct function name i.e. 
    select pg_reload_conf();

2) postgres@ospostgresql:/$ /usr/lib/postgresql/11/bin/pg_ctl reload
pg_ctl: no database directory specified and environment variable PGDATA unset
Try "pg_ctl --help" for more information.
**-->** This error is resolved by changing the user to postgres
    1) su postgres
    2) /usr/lib/postgresql/11/bin/pg_ctl -D /var/lib/postgresql/11/main reload