From fbf826bf0c0799cc8c87e864e116a6fe1f0e860e Mon Sep 17 00:00:00 2001 From: support Date: Sun, 11 Oct 2026 16:45:57 +0200 Subject: [PATCH] 2026-10-11 14:45:57 --- PostgreSQL/build_rdbms_01/Readme.md | 55 ++++-- PostgreSQL/build_rdbms_01/install_common.sh | 106 +++++++++++ PostgreSQL/build_rdbms_01/install_pg_cron.sh | 25 ++- .../build_rdbms_01/install_pg_repack.sh | 25 ++- .../build_rdbms_01/install_pg_stat_monitor.sh | 25 ++- .../install_pg_stat_statements.sh | 25 ++- PostgreSQL/build_rdbms_01/install_pgaudit.sh | 25 ++- PostgreSQL/build_rdbms_01/install_pgvector.sh | 25 ++- .../build_rdbms_01/install_postgresql.sh | 36 +++- .../install_postgresql_extensions.sh | 168 ++++++++++++++++-- PostgreSQL/build_rdbms_01/install_set_user.sh | 25 ++- .../build_rdbms_01/install_timescaledb.sh | 29 ++- 12 files changed, 512 insertions(+), 57 deletions(-) diff --git a/PostgreSQL/build_rdbms_01/Readme.md b/PostgreSQL/build_rdbms_01/Readme.md index 6d36213..7564a27 100644 --- a/PostgreSQL/build_rdbms_01/Readme.md +++ b/PostgreSQL/build_rdbms_01/Readme.md @@ -16,6 +16,23 @@ Run the orchestrator with the PostgreSQL version to install: ./install_postgresql_extensions.sh 18.6 ``` +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/`. `-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. + The orchestrator runs the installers in this order: 1. PostgreSQL @@ -32,27 +49,41 @@ After a successful run, the orchestrator: - Optionally updates `shared_preload_libraries` when `CONFIG_FILE` is set. - Prints the installed PostgreSQL and extension versions. -- Creates `postgresql--engine.tar.gz` in the directory from which the command was launched. +- Recreates `sources//` before starting, where `` 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_.sh` recipe containing that component's configure/build/install commands. +- Creates `postgresql--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`). - Writes the complete process log to `postgresql--process.log` in that same directory. +- Prints and logs the total execution duration in hours, minutes, and seconds. ## Individual installers Each component can also be installed independently. The PostgreSQL installation must already exist before running an extension installer. ```bash -./install_postgresql.sh 18.6 -./install_pg_cron.sh 18.6 -./install_timescaledb.sh 18.6 -./install_pgaudit.sh 18.6 -./install_set_user.sh 18.6 -./install_pg_stat_statements.sh 18.6 -./install_pg_repack.sh 18.6 -./install_pg_stat_monitor.sh 18.6 -./install_pgvector.sh 18.6 +./install_postgresql.sh --version 18.6 +./install_pg_cron.sh --version 18.6 +./install_timescaledb.sh --version 18.6 +./install_pgaudit.sh --version 18.6 +./install_set_user.sh --version 18.6 +./install_pg_stat_statements.sh --version 18.6 +./install_pg_repack.sh --version 18.6 +./install_pg_stat_monitor.sh --version 18.6 +./install_pgvector.sh --version 18.6 ``` +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_.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. + ## Script descriptions ### `install_postgresql_extensions.sh` @@ -61,7 +92,7 @@ All-in-one entry point. It invokes every installer, applies optional configurati ### `install_postgresql.sh` -Downloads, configures, builds, and installs PostgreSQL. The build uses: +Downloads, configures, builds, and installs PostgreSQL. By default, `configure` uses: ```text --with-ssl=openssl @@ -118,6 +149,8 @@ The following environment variables can override defaults: | Variable | Default | Purpose | | --- | --- | --- | | `POSTGRES_ROOT` | `/app/postgres/rdbms` | Root directory for versioned PostgreSQL installations | +| `-p`, `--prefix` | `/app/postgres/rdbms/` | Exact PostgreSQL installation prefix | +| `-o`, `--options` | `--with-ssl=openssl,--with-lz4` | Comma-separated PostgreSQL `configure` options | | `STAGING_DIR` | `