gpt4 book ai didi

postgresql - 覆盖Postgres Docker容器中的单个配置

转载 作者:行者123 更新时间:2023-12-02 19:25:52 24 4
gpt4 key购买 nike

我正在尝试覆盖官方Postgres Docker图像的Postgres配置中的单个项目。即,我想覆盖log_statement属性并将其设置为all

尝试过:

docker run -d -e POSTGRES_PASSWORD=postgres postgres -c 'log_statement=all' 

输入docker容器并执行后:
cat /var/lib/postgresql/data/postgresql.conf | grep log_statement

仍然获得默认值 none

但没有成功。

关于 Postgres Docker配置,有一些答案/问题,但他们建议替换完整的 postgresql.conf文件。

最佳答案

docs:

Command-line options override any conflicting settings in postgresql.conf. Note that this means you won't be able to change the value on-the-fly by editing postgresql.conf, so while the command-line method might be convenient, it can cost you flexibility later.



据我了解,这不会更改 postgresql.conf,但实际上会使用所需选项运行 postgres命令。这可能就是为什么在配置文件中看不到设置为 all的值的原因。

希望能帮助到你。

关于postgresql - 覆盖Postgres Docker容器中的单个配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56254339/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com