2026-10-24 14:41:40

This commit is contained in:
support committed 2026-10-24 16:41:41 +02:00
1 parent cbf1765417
commit d67470f0e5
5 files changed
+69 -6

No files matched your search

+11 -2
View File
@@ -48,6 +48,7 @@ The orchestrator runs the installers in this order:
11. pgvector
12. HypoPG
13. pg_hint_plan
14. wal2json
After a successful run, the orchestrator:
@@ -76,6 +77,7 @@ Each component can also be installed independently. The PostgreSQL installation
./install_pgvector.sh --version 18.6
./install_hypopg.sh --version 18.6
./install_pg_hint_plan.sh --version 18.6
./install_wal2json.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.
@@ -169,6 +171,10 @@ Builds and installs HypoPG against the selected PostgreSQL installation. Create
Builds and installs the pg_hint_plan tag matching the PostgreSQL major version when available. Create it in each database where it will be used with `CREATE EXTENSION pg_hint_plan`.
### `install_wal2json.sh`
Builds and installs wal2json as a PostgreSQL logical decoding output plugin. It does not use `CREATE EXTENSION` or require `shared_preload_libraries`; configure PostgreSQL with `wal_level = logical` and restart the server before creating a logical replication slot that uses the `wal2json` plugin.
### `install_common.sh`
Shared helper functions used by the installers, including:
@@ -201,6 +207,7 @@ The following environment variables can override defaults:
| `PGVECTOR_TAG` | Latest release/tag | pgvector source tag |
| `HYPOPG_TAG` | Latest release/tag | HypoPG source tag |
| `PG_HINT_PLAN_TAG` | PostgreSQL-major-compatible tag | pg_hint_plan source tag |
| `WAL2JSON_TAG` | Latest release/tag | wal2json source tag |
Repository variables can also be overridden when using a custom mirror:
@@ -214,6 +221,7 @@ PG_STAT_MONITOR_REPOSITORY=owner/repository
PGVECTOR_REPOSITORY=owner/repository
HYPOPG_REPOSITORY=owner/repository
PG_HINT_PLAN_REPOSITORY=owner/repository
WAL2JSON_REPOSITORY=owner/repository
```
Example:
@@ -233,7 +241,7 @@ When `CONFIG_FILE` is supplied, the orchestrator adds the modules and extensions
shared_preload_libraries = 'pg_cron,timescaledb,pgaudit,pg_stat_statements,pg_stat_monitor,passwordcheck'
```
`pg_repack`, pgvector, HypoPG, and `set_user` do not require `shared_preload_libraries`. `auto_explain` and pg_hint_plan can be loaded per session or configured for server startup; they are not added automatically. `passwordcheck` and `auto_explain` are PostgreSQL contrib modules (not SQL extensions), and `pg_stat_activity` is a built-in PostgreSQL system view.
`pg_repack`, pgvector, HypoPG, `set_user`, and wal2json do not require `shared_preload_libraries`. `auto_explain` and pg_hint_plan can be loaded per session or configured for server startup; they are not added automatically. wal2json is a logical decoding output plugin and requires `wal_level = logical` plus a server restart before use. `passwordcheck` and `auto_explain` are PostgreSQL contrib modules (not SQL extensions), and `pg_stat_activity` is a built-in PostgreSQL system view.
## Prerequisites
@@ -276,7 +284,8 @@ ls \
/app/postgres/rdbms/18.6/lib/pg_stat_monitor.so \
/app/postgres/rdbms/18.6/lib/auto_explain.so \
/app/postgres/rdbms/18.6/lib/hypopg.so \
/app/postgres/rdbms/18.6/lib/pg_hint_plan.so
/app/postgres/rdbms/18.6/lib/pg_hint_plan.so \
/app/postgres/rdbms/18.6/lib/wal2json.so
```
The extension SQL objects still need to be created in each target database with PostgreSQL's `CREATE EXTENSION` command.
@@ -159,6 +159,7 @@ mkdir -p "$SOURCES_DIR"
"$SCRIPT_DIR/install_pgvector.sh" --version "$POSTGRES_VERSION"
"$SCRIPT_DIR/install_hypopg.sh" --version "$POSTGRES_VERSION"
"$SCRIPT_DIR/install_pg_hint_plan.sh" --version "$POSTGRES_VERSION"
"$SCRIPT_DIR/install_wal2json.sh" --version "$POSTGRES_VERSION"
readonly CONFIG_FILE="${CONFIG_FILE:-}"
readonly SHARED_PRELOAD_LIBRARIES="pg_cron,timescaledb,pgaudit,pg_stat_statements,pg_stat_monitor,passwordcheck"
@@ -217,6 +218,7 @@ printf ' pg_stat_monitor: %s\n' "$(extension_version pg_stat_monitor)"
printf ' pgvector: %s\n' "$(extension_version vector)"
printf ' hypopg: %s\n' "$(extension_version hypopg)"
printf ' pg_hint_plan: %s\n' "$(extension_version pg_hint_plan)"
printf ' wal2json: logical decoding output plugin\n'
printf " shared_preload_libraries = '%s'\n" "$SHARED_PRELOAD_LIBRARIES"
rm -f -- "$ENGINE_ARCHIVE"
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
set -Eeuo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=install_common.sh
source "$SCRIPT_DIR/install_common.sh"
readonly STAGING_DIR="${STAGING_DIR:-$SCRIPT_DIR/tmp}"
readonly POSTGRES_ROOT="${POSTGRES_ROOT:-/app/postgres/rdbms}"
readonly WAL2JSON_REPOSITORY="${WAL2JSON_REPOSITORY:-eulerto/wal2json}"
if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
show_help "$0" "Build and install wal2json for an existing PostgreSQL installation."
exit 0
fi
POSTGRES_VERSION="$(parse_postgresql_version "$@")"
readonly POSTGRES_VERSION
require_tools curl tar make
readonly PREFIX="${PREFIX:-$POSTGRES_ROOT/$POSTGRES_VERSION}"
readonly PG_CONFIG="$PREFIX/bin/pg_config"
require_postgresql_installation "$PREFIX"
reset_staging_dir "$STAGING_DIR"
readonly WAL2JSON_TAG="${WAL2JSON_TAG:-$(latest_tag "$WAL2JSON_REPOSITORY")}"
[[ -n "$WAL2JSON_TAG" ]] || die "could not determine the latest wal2json release"
readonly WAL2JSON_DIR="$STAGING_DIR/wal2json-$WAL2JSON_TAG"
printf 'Building wal2json %s\n' "$WAL2JSON_TAG"
download_source "$STAGING_DIR" "$WAL2JSON_REPOSITORY" "$WAL2JSON_TAG" \
"wal2json-$WAL2JSON_TAG.tar.gz" "$WAL2JSON_DIR"
cd "$WAL2JSON_DIR"
make -j"${JOBS:-$(nproc)}" USE_PGXS=1 PG_CONFIG="$PG_CONFIG"
make install USE_PGXS=1 PG_CONFIG="$PG_CONFIG"
test -f "$PREFIX/lib/wal2json.so"
readonly SAVED_SOURCE_DIR="$(copy_install_source "$WAL2JSON_DIR" "$PREFIX" "wal2json-$WAL2JSON_TAG")"
write_install_recipe "$SAVED_SOURCE_DIR" "$POSTGRES_VERSION" "$PREFIX" <<'RECIPE'
cd "$SCRIPT_DIR"
# Configure
# wal2json uses PGXS directly and does not require a separate configure step.
# Make
make -j"$JOBS" USE_PGXS=1 PG_CONFIG="$PG_CONFIG"
# Make install
make install USE_PGXS=1 PG_CONFIG="$PG_CONFIG"
RECIPE
+3 -3
View File
@@ -1,5 +1,5 @@
./install_postgresql_extensions.sh \
--version 17.11 \
--prefix /app/staging_area/postgres/rdbms/17.11 \
--options="--with-ssl=openssl,--with-ls4"
--version 18.6 \
--prefix /app/staging_area/postgres/rdbms/18.6 \
--options="--with-ssl=openssl,--with-lz4"