Skip to content

Commit

Permalink
Add CREATE_OPTIONS variable to pg-start
Browse files Browse the repository at this point in the history
So that options can be passed to pg_createcluster.
  • Loading branch information
theory committed Jul 9, 2024
1 parent 0b209a2 commit fffe53f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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

0 comments on commit fffe53f

Please sign in to comment.