Skip to content

Commit

Permalink
Introduce environment variable POSTGRESQL_DEFAULT_TRANSACTION_ISOLATI…
Browse files Browse the repository at this point in the history
…ON (#25013)

Signed-off-by: Florian Kamella <florian.kamella@cronn.de>
  • Loading branch information
Florian Kamella committed Sep 8, 2023
1 parent 5a072a4 commit f197394
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ if [[ -n "${POSTGRESQL_EXTRA_FLAGS:-}" ]]; then
flags+=("${extra_flags[@]}")
fi

if [[ -n "${POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION:-}" ]]; then
flags+=("-c" "default_transaction_isolation=$POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION")
fi

flags+=("$@")

cmd=$(command -v postgres)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ if [[ -n "${POSTGRESQL_EXTRA_FLAGS:-}" ]]; then
flags+=("${extra_flags[@]}")
fi

if [[ -n "${POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION:-}" ]]; then
flags+=("-c" "default_transaction_isolation=$POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION")
fi

flags+=("$@")

cmd=$(command -v postgres)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ if [[ -n "${POSTGRESQL_EXTRA_FLAGS:-}" ]]; then
flags+=("${extra_flags[@]}")
fi

if [[ -n "${POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION:-}" ]]; then
flags+=("-c" "default_transaction_isolation=$POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION")
fi

flags+=("$@")

cmd=$(command -v postgres)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ if [[ -n "${POSTGRESQL_EXTRA_FLAGS:-}" ]]; then
flags+=("${extra_flags[@]}")
fi

if [[ -n "${POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION:-}" ]]; then
flags+=("-c" "default_transaction_isolation=$POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION")
fi

flags+=("$@")

cmd=$(command -v postgres)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ if [[ -n "${POSTGRESQL_EXTRA_FLAGS:-}" ]]; then
flags+=("${extra_flags[@]}")
fi

if [[ -n "${POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION:-}" ]]; then
flags+=("-c" "default_transaction_isolation=$POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION")
fi

flags+=("$@")

cmd=$(command -v postgres)
Expand Down
11 changes: 11 additions & 0 deletions bitnami/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,17 @@ Passing extra command-line flags to the postgresql service command is possible t

* `POSTGRESQL_EXTRA_FLAGS`: Flags to be appended to the `postgres` startup command. No defaults

#### Adjusting the default transaction isolation level

The default transaction isolation level in postgresql is `read committed`, the global default transaction isolation

Check warning on line 186 in bitnami/postgresql/README.md

View workflow job for this annotation

GitHub Actions / markdown-linter

MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
level can be changed using the environment variable `POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION`.

Possible values are: `read uncommitted`, `read committed`, `repeatable read` or `serializable`. For more details consult

Check warning on line 189 in bitnami/postgresql/README.md

View workflow job for this annotation

GitHub Actions / markdown-linter

MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
the documentation for `default_transaction_isolation` in https://www.postgresql.org/docs/current/runtime-config-client.html

Check warning on line 190 in bitnami/postgresql/README.md

View workflow job for this annotation

GitHub Actions / markdown-linter

MD034/no-bare-urls Bare URL used [Context: "https://www.postgresql.org/doc..."]

*Note: Setting `default_transaction_isolation` via `POSTGRESQL_EXTRA_FLAGS` is currently only possible for

Check warning on line 192 in bitnami/postgresql/README.md

View workflow job for this annotation

GitHub Actions / markdown-linter

MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
transaction levels without white spaces in its name.*

### Initializing a new instance

When the container is executed for the first time, it will execute the files with extensions `.sh`, `.sql` and `.sql.gz` located at `/docker-entrypoint-initdb.d`.
Expand Down

0 comments on commit f197394

Please sign in to comment.