Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CREATE_OPTIONS variable to pg-start #19

Merged
merged 1 commit into from
Jul 9, 2024
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
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,17 @@ authentication enabled. If you need the cluster configured with a specific
locale (for collation predictability, for example), set the `$LANG` environment
variable before calling `pg-start`.

If you need to access the `postgresql.conf`, say to add additional configuration,
you can use the `SHOW config_file` SQL command like so:
The `pg-start` tool uses [`pg_createcluster`] to create and start the cluster.
To pass options, use the `$OPTIONS` environment variable. For example, to add
a GUC to the `postgresql.conf` file, use the `--pgoption` option:

``` sh
CREATE_OPTIONS="--pgoption max_locks_per_transaction=128" pg-start
```

If you need to access the `postgresql.conf` after startup, say to add
additional configuration, you can use the `SHOW config_file` SQL command like
so:

``` sh
psql --no-psqlrc -U postgres -Atqc 'SHOW config_file'
Expand Down
3 changes: 2 additions & 1 deletion bin/pg-start
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fi
set +x
if [ -z ${NO_CLUSTER+x} ]; then
set -x
sudo pg_createcluster --start "$PGVERSION" test -p "${PGPORT:-5432}" -- -A trust
# shellcheck disable=SC2086 # ${CREATE_OPTIONS:-} must be unquoted
sudo pg_createcluster --start "$PGVERSION" test -p "${PGPORT:-5432}" ${CREATE_OPTIONS:-} -- -A trust
fi
set -x