These shell scripts build PostgreSQL from source and install PostgreSQL extensions into a versioned prefix:
```text
/app/postgres/rdbms/<postgresql-version>
```
The scripts use strict Bash error handling and require a working compiler and build environment. Sources are downloaded from the PostgreSQL FTP site and GitHub repositories.
## Install everything
Run the orchestrator with the PostgreSQL version to install:
The version may also be supplied explicitly with `-v` or `--version`:
```bash
./install_postgresql_extensions.sh --version 18.6
```
The orchestrator accepts a custom installation prefix and PostgreSQL `configure` options:
```bash
./install_postgresql_extensions.sh \
--version 18.6 \
--prefix /app/postgres/rdbms/18.6 \
--options="--with-ssl=openssl,--with-lz4"
```
`-p`/`--prefix` defaults to `/app/postgres/rdbms/<version>`. `-o`/`--options` accepts a comma-separated list of `configure` arguments; if omitted, the defaults are `--with-ssl=openssl,--with-lz4`. The prefix is passed to all component installers. If the selected prefix already exists, the orchestrator asks whether to recreate it; the prompt defaults to No, and non-interactive runs cancel safely.
- Recreates `sources/<complete-version>/` before starting, where `<complete-version>` is the final directory name of the selected prefix (for example, prefix `/app/postgres/rdbms/18.6.3` uses `sources/18.6.3/`). Each successfully installed component's source tree is saved there with an executable `install_<postgresql-version>.sh` recipe containing that component's configure/build/install commands.
- Creates `postgresql-<prefix-basename>-engine.tar.gz` in the directory from which the command was launched (for example, a prefix ending in `18.6.3` produces `postgresql-18.6.3-engine.tar.gz`).
Each installer also accepts `-v 18.6` and the previous positional form (`./install_pg_cron.sh 18.6`). The all-in-one orchestrator passes its complete `--version` value to every component installer.
All source downloads, extracted source trees, and build workspaces use the `tmp/` directory alongside the scripts by default. `install_postgresql.sh` recreates that staging directory and the versioned PostgreSQL prefix before downloading sources. Each extension installer recreates only the staging directory and preserves the PostgreSQL prefix.
When the main orchestrator is invoked without `--help` or `-h`, it first recreates `tmp/` alongside the scripts. Help mode prints usage only and does not create, delete, or modify files.
Every installer accepts `--help` or `-h`, for example:
```bash
./install_pgvector.sh --help
```
The generated `install_<version>.sh` recipes also accept `--help`/`-h` and can be run from their saved component source directory to repeat that component's configure/build/install steps.
All-in-one entry point. It invokes every installer, applies optional configuration changes, prints a product summary, writes a process log, and packages the installed PostgreSQL prefix.
Downloads the matching PostgreSQL source tree and builds the `passwordcheck` contrib module using PGXS. The module is loaded at server startup through `shared_preload_libraries`; it does not have a `CREATE EXTENSION` control file.
`pg_repack`, pgvector, and `set_user` do not require `shared_preload_libraries`. `passwordcheck` is a PostgreSQL contrib module (not a SQL extension), and `pg_stat_activity` is a built-in PostgreSQL system view.