如何重新加载 PostgreSQL 配置
我试图通过设置此标志来启用 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.
I am trying to enable the transaction logs in PostgreSQL, where query run time is more than 3 seconds, by setting this flag
log_min_duration_statement = 3000
How to reload the configuration file without restarting the Postgres?
I've tried the below options and got these errors
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
感谢 a_horse_with_no_name 帮助识别导致问题 1 的拼写错误
Thank you a_horse_with_no_name in helping to identify the typo which causes issue-1
上面的答案显示了 2 种方法来执行此操作,但我发现有 3 种不同的方法来加载 Postgresql 配置。显然
systemctl reload postgresql
也可以工作。参考: https://www.heatware.net/postgresql/postgresql -reload-config-without-restarting/
The above answer shows 2 ways to do this, but I found that there are 3 different ways to load Postgresql configuration. Apparently
systemctl reload postgresql
will also work.Reference: https://www.heatware.net/postgresql/postgresql-reload-config-without-restarting/
请使用:
或简单地:
Please use:
Or simply: