繁体   English   中英

如何在设置时更改 postgres docker image wal 级别?

[英]How to change postgres docker image wal level on setup?

我正在为我的一个应用程序使用 postgres:11.6-alpine 图像,我想在设置时将图像 wal_level 设置为“逻辑”,最好使用 docker-compose。

我找到的解决方案需要您覆盖图像 postgresql.conf。 但是,我不想为了更改此设置而拥有完整的 postgresql.conf 文件。

有什么办法可以做到这一点吗?

像这样更新 PostgreSQL 容器配置的command部分。

services:
  postgres:
    image: postgres:11.6-alpine
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_DB=my_db
      - POSTGRES_PASSWORD=changeme
    command:
      - "postgres"
      - "-c"
      - "wal_level=logical"

或者

    command: [ "postgres", "-c", "wal_level=logical" ]

如果您更喜欢这种格式。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM