kartoza / docker-postgis

Dockerfile for postgis
GNU General Public License v2.0
648 stars 317 forks source link

WAL_LEVEL environment variable is ignored #429

Closed devrimbaris closed 1 year ago

devrimbaris commented 1 year ago

What is the bug or the crash?

I am trying to enable wal_level as logical with kartoza/postgis image with no success.

1-I have tried to enable wal_level as logical with following docker run command:

docker run -it --rm -e POSTGRES_USER=xx -e POSTGRES_PASS=xx -e POSTGRES_DBNAME=xx -e WAL_LEVEL=logical -p 5432:5432 kartoza/postgis:14

This didn't work.

I also tried to enable it via startup configuration which works with postgis and postgresql images. For example the below command works in enabling logical wal_level.

docker run -it --rm -e POSTGRES_USER=xx -e POSTGRES_PASSWORD=xx -e POSTGRES_DB=xx -p 5432:5432 postgis/postgis:14-3.3-alpine -c 'wal_level=logical'

I also tried to enable logical wal_level with a custom postgresql.conf file having a line related to wal_level setting and running the following command:

docker run -it --rm -v "$PWD/my-postgres.conf":/etc/postgresql/postgresql.conf -e POSTGRES_USER=xx -e POSTGRES_PASSWORD=xx -e POSTGRES_DB=xx -p 5432:5432 kartoza/postgis:14 postgres -c 'config_file=/etc/postgresql/postgresql.conf'

This also didn't work.

I am out of ideas and I really like to use kartoza/postgis because its support for arm64 which hugely improves performance on my m1. Best regards.

Steps to reproduce the issue

docker run -it --rm -e POSTGRES_USER=xx -e POSTGRES_PASS=xx -e POSTGRES_DBNAME=xx -e WAL_LEVEL=logical -p 5432:5432 kartoza/postgis:14

docker run -it --rm -e POSTGRES_USER=xx -e POSTGRES_PASSWORD=xx -e POSTGRES_DB=xx -p 5432:5432 postgis/postgis:14-3.3-alpine -c 'wal_level=logical'

docker run -it --rm -v "$PWD/my-postgres.conf":/etc/postgresql/postgresql.conf -e POSTGRES_USER=xx -e POSTGRES_PASSWORD=xx -e POSTGRES_DB=xx -p 5432:5432 kartoza/postgis:14 postgres -c 'config_file=/etc/postgresql/postgresql.conf'

Versions

kartoza/postgis:14

Additional context

No response

NyakudyaA commented 1 year ago

By default replication is off because we do not know which type you are looking for try setting -e REPLICATION=true

NyakudyaA commented 1 year ago

@devrimbaris The assumption here is that -e WAL_LEVEL=logical implies that we are going to do replication. As indicated here https://github.com/kartoza/docker-postgis/blob/develop/scripts/setup-conf.sh#L46. If this is the case I suggest we could improve the situation by either

NyakudyaA commented 1 year ago

will update documentation