Feature description
The current logic in https://github.com/kartoza/docker-postgis/blob/develop/scripts/setup-database.sh#L38 allows us to create a database cluster with specific locales only if ${RECREATE_DATADIR} is set.
This then sets INITDB to initiate a cluster with the specific locale I.e
command="$INITDB -U postgres --pwfile=<(echo $POSTGRES_PASS) -E ${DEFAULT_ENCODING} --lc-collate=${DEFAULT_COLLATION} --lc-ctype=${DEFAULT_CTYPE} --wal-segsize=${WAL_SEGSIZE} --auth=${PASSWORD_AUTHENTICATION} -D ${DATADIR} ${INITDB_WALDIR_FLAG} ${INITDB_EXTRA_ARGS}"
With the env value set to
RECREATE_DATADIR any database restarts will result in wiping the database cluster repeatedly.
Also this means this DB always gets started with the default collate that's set when you install postgresql.
Possible solution
We need to add
DATADIR_RECREATE_MODE:
# "never" - Never recreate (default)
# "once" - Recreate once per container lifetime
# "always" - Recreate on every start
# "empty" - Recreate only if datadir is empty
Feature description
The current logic in https://github.com/kartoza/docker-postgis/blob/develop/scripts/setup-database.sh#L38 allows us to create a database cluster with specific locales only if
${RECREATE_DATADIR}is set.This then sets INITDB to initiate a cluster with the specific locale I.e
With the env value set to
RECREATE_DATADIRany database restarts will result in wiping the database cluster repeatedly.Also this means this DB always gets started with the default collate that's set when you install postgresql.
Possible solution
We need to add