Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions bitnami/postgresql/14/debian-12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ ARG WITH_ALL_LOCALES="no"

LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
org.opencontainers.image.created="2025-03-03T21:37:33Z" \
org.opencontainers.image.created="2025-03-15T20:48:36Z" \
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/postgresql/README.md" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.ref.name="14.17.0-debian-12-r3" \
org.opencontainers.image.ref.name="14.17.0-debian-12-r4" \
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/postgresql" \
org.opencontainers.image.title="postgresql" \
org.opencontainers.image.vendor="Broadcom, Inc." \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,13 @@ postgresql_clean_from_restart() {
local -r -a files=(
"$POSTGRESQL_DATA_DIR"/postmaster.pid
"$POSTGRESQL_DATA_DIR"/standby.signal
"$POSTGRESQL_DATA_DIR"/recovery.signal
)

# Enable recovery only when POSTGRESQL_PERFORM_RESTORE feature flag is set
if ! is_boolean_yes "$POSTGRESQL_PERFORM_RESTORE" ; then
files+=("$POSTGRESQL_DATA_DIR"/recovery.signal)
fi

for file in "${files[@]}"; do
if [[ -f "$file" ]]; then
info "Cleaning stale $file file"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ postgresql_env_vars=(
POSTGRESQL_DEFAULT_TOAST_COMPRESSION
POSTGRESQL_PASSWORD_ENCRYPTION
POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION
POSTGRESQL_PERFORM_RESTORE
POSTGRESQL_AUTOCTL_CONF_DIR
POSTGRESQL_AUTOCTL_MODE
POSTGRESQL_AUTOCTL_MONITOR_HOST
Expand Down Expand Up @@ -336,6 +337,9 @@ export POSTGRESQL_PASSWORD_ENCRYPTION="${POSTGRESQL_PASSWORD_ENCRYPTION:-}"
export POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION="${POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION:-}"
export POSTGRESQL_USE_CUSTOM_PGHBA_INITIALIZATION="no"

# Native recovery settings
export POSTGRESQL_PERFORM_RESTORE="${POSTGRESQL_PERFORM_RESTORE:-no}"

# pgAutoFailover settings
export POSTGRESQL_AUTOCTL_VOLUME_DIR="${POSTGRESQL_VOLUME_DIR}/pgautoctl"
export POSTGRESQL_AUTOCTL_CONF_DIR="${POSTGRESQL_AUTOCTL_CONF_DIR:-${POSTGRESQL_AUTOCTL_VOLUME_DIR}/.config}"
Expand Down
12 changes: 6 additions & 6 deletions bitnami/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ docker-compose up -d
#### Customizable environment variables

| Name | Description | Default Value |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------ |
|--------------------------------------------|--------------------------------------------------------------------------------------------------|--------------------------------------------|
| `POSTGRESQL_VOLUME_DIR` | Persistence base directory | `/bitnami/postgresql` |
| `POSTGRESQL_DATA_DIR` | PostgreSQL data directory | `${POSTGRESQL_VOLUME_DIR}/data` |
| `POSTGRESQL_EXTRA_FLAGS` | Extra flags for PostgreSQL initialization | `nil` |
Expand Down Expand Up @@ -245,16 +245,16 @@ docker-compose up -d
| `POSTGRESQL_DEFAULT_TOAST_COMPRESSION` | Set the postgres default compression | `nil` |
| `POSTGRESQL_PASSWORD_ENCRYPTION` | Set the passwords encryption method | `nil` |
| `POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION` | Set transaction isolation | `nil` |
| `POSTGRESQL_PERFORM_RESTORE` | Flag to skip deletion of `recovery.signal` file to enable native recovery. e.g by using `wal-g` | `no` |
| `POSTGRESQL_AUTOCTL_CONF_DIR` | Path to the configuration dir for the pg_autoctl command | `${POSTGRESQL_AUTOCTL_VOLUME_DIR}/.config` |
| `POSTGRESQL_AUTOCTL_MODE` | pgAutoFailover node type, valid values [monitor, postgres] | `postgres` |
| `POSTGRESQL_AUTOCTL_MONITOR_HOST` | Hostname for the monitor component | `monitor` |
| `POSTGRESQL_AUTOCTL_HOSTNAME` | Hostname by which postgres is reachable | `$(hostname --fqdn)` |
| `POSTGRESQL_PERFORM_RESTORE` | Flag to skip deletion of `recovery.signal` file to enable native recovery. e.g by using `wal-g` | `false` |

#### Read-only environment variables

| Name | Description | Value |
| -------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------- |
|----------------------------------------------|-----------------------------------------------------------------|-----------------------------------------------|
| `POSTGRESQL_BASE_DIR` | PostgreSQL installation directory | `/opt/bitnami/postgresql` |
| `POSTGRESQL_DEFAULT_CONF_DIR` | PostgreSQL configuration directory | `$POSTGRESQL_BASE_DIR/conf.default` |
| `POSTGRESQL_CONF_DIR` | PostgreSQL configuration directory | `$POSTGRESQL_BASE_DIR/conf` |
Expand Down Expand Up @@ -576,7 +576,7 @@ postgres=# select application_name as server, state,
postgres-# sync_priority as priority, sync_state
postgres-# from pg_stat_replication;
| server | state | priority | sync_state |
| ----------- | --------- | -------- | ---------- |
|-------------|-----------|----------|------------|
| walreceiver | streaming | 0 | sync |
| walreceiver | streaming | 0 | async |
```
Expand Down Expand Up @@ -804,7 +804,7 @@ docker build --build-arg EXTRA_LOCALES="es_ES.UTF-8 UTF-8" ...
The Bitnami PostgreSQL container allows two different sets of environment variables. Please see the list of environment variable aliases in the next table:

| Environment Variable | Alias |
| :----------------------------------- | :--------------------------------- |
|:-------------------------------------|:-----------------------------------|
| POSTGRESQL_USERNAME | POSTGRES_USER |
| POSTGRESQL_DATABASE | POSTGRES_DB |
| POSTGRESQL_PASSWORD | POSTGRES_PASSWORD |
Expand Down Expand Up @@ -835,7 +835,7 @@ alter database POSTGRES_DATABASE owner to POSTGRES_USER;
It is possible to change the user that PostgreSQL will use to execute the init scripts. To do so, use the following environment variables:

| Environment variable | Description |
| ------------------------------- | ----------------------------------------------------------------- |
|---------------------------------|-------------------------------------------------------------------|
| POSTGRESQL_INITSCRIPTS_USERNAME | User that will be used to execute the init scripts |
| POSTGRESQL_INITSCRIPTS_PASSWORD | Password for the user specified in POSTGRESQL_INITSCRIPT_USERNAME |

Expand Down
Loading