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:
```bash
./install_postgresql_extensions.sh 18.6
```
The orchestrator runs the installers in this order:
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.
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.
### `install_postgresql.sh`
Downloads, configures, builds, and installs PostgreSQL. The build uses:
```text
--with-ssl=openssl
--with-lz4
```
### `install_pg_cron.sh`
Builds and installs `pg_cron` against the selected PostgreSQL installation.
### `install_timescaledb.sh`
Bootstraps and builds TimescaleDB with CMake, installing it into the selected PostgreSQL prefix.
### `install_pgaudit.sh`
Builds and installs pgAudit using PostgreSQL PGXS. It selects a tag matching the PostgreSQL major version when possible.
### `install_set_user.sh`
Builds and installs the `set_user` extension using the selected PostgreSQL `pg_config`.
### `install_pg_stat_statements.sh`
Downloads the matching PostgreSQL source tree and builds `pg_stat_statements` from `contrib` using PGXS.
### `install_pg_repack.sh`
Builds and installs the `pg_repack` extension and its `pg_repack` command-line utility.
### `install_pg_stat_monitor.sh`
Builds and installs Percona's `pg_stat_monitor` extension.
`pg_repack` and `set_user` do not require `shared_preload_libraries`. `pg_stat_activity` is a PostgreSQL system view and is not installed as an extension.
## Prerequisites
The scripts check for the tools needed by each build. The complete procedure requires:
- Bash
-`curl`
-`tar`
-`make`
-`gcc`
-`cmake`
-`python3` when `CONFIG_FILE` is used
- Standard PostgreSQL build dependencies, including OpenSSL and LZ4 development libraries
## Validation
Validate all shell scripts:
```bash
for script in install_*.sh;do
bash -n "$script"
done
```
Check an installed PostgreSQL version:
```bash
/app/postgres/rdbms/18.6/bin/postgres --version
/app/postgres/rdbms/18.6/bin/pg_config --version
```
Check installed extension files:
```bash
ls \
/app/postgres/rdbms/18.6/lib/pg_cron.so \
/app/postgres/rdbms/18.6/lib/timescaledb.so \
/app/postgres/rdbms/18.6/lib/pgaudit.so \
/app/postgres/rdbms/18.6/lib/set_user.so \
/app/postgres/rdbms/18.6/lib/pg_stat_monitor.so
```
The extension SQL objects still need to be created in each target database with PostgreSQL's `CREATE EXTENSION` command.