Add VectorChord extension, server defaults, and healthcheck #3

Merged
MHE merged 4 commits from review-postgres-image-defaults-params into main 2026-11-01 14:38:24 +01:00
Owner

Summary

Adds VectorChord 1.1.1 to the postgres image behind a new POSTGRES_VECTORCHORD switch, applies server defaults on every start, and ships a healthcheck script that fails on checksum errors.

What changed

  • Dockerfile: pins POSTGRES_VECTORCHORD_VERSION=1.1.1 and installs the postgresql-18-vchord package from the official VectorChord GitHub release. The release tag and asset URL are validated, and the SHA256 digest is taken from the release metadata and checked before install.
  • entrypoint.postgresql.sh:
    • New POSTGRES_VECTORCHORD switch. It enables vector, preloads vchord.so, and applies the Immich server profile (search_path, max_wal_size, shared_buffers, work_mem, autovacuum tuning).
    • Every start sets summarize_wal=on and wal_compression=on. DB_STORAGE_TYPE selects the SSD profile (default) or HDD.
    • POSTGRES_INITDB_ARGS defaults to --data-checksums when unset.
    • POSTGRES_EXTRA_OPTS appends validated name=value settings. hba_file is rejected and always set last.
    • Immich-style DB_* variables fill the official POSTGRES_* names when those are empty.
    • Refuses data directories on network or shared-folder filesystems unless IGNORE_DATABASE_FSTYPE=true.
    • Main logic is guarded so the script can be sourced for testing.
  • init_extensions.postgresql.sh: creates vchord on first init when the switch is set, with the same guard.
  • healthcheck.postgresql.sh (new): runs pg_isready and fails if pg_stat_database reports any checksum failures.
  • .dockerignore / Dockerfile: copy and make executable the new healthcheck.
  • README.md / AGENTS.md: document the new switch, the server defaults, and the version pin.

Why

The Immich server needs VectorChord and its tuning profile. Checksums and the healthcheck make silent corruption visible. The storage and extra-options knobs let deployments tune without building a new image.

## Summary Adds VectorChord 1.1.1 to the postgres image behind a new `POSTGRES_VECTORCHORD` switch, applies server defaults on every start, and ships a healthcheck script that fails on checksum errors. ## What changed - **Dockerfile**: pins `POSTGRES_VECTORCHORD_VERSION=1.1.1` and installs the `postgresql-18-vchord` package from the official VectorChord GitHub release. The release tag and asset URL are validated, and the SHA256 digest is taken from the release metadata and checked before install. - **entrypoint.postgresql.sh**: - New `POSTGRES_VECTORCHORD` switch. It enables `vector`, preloads `vchord.so`, and applies the Immich server profile (`search_path`, `max_wal_size`, `shared_buffers`, `work_mem`, autovacuum tuning). - Every start sets `summarize_wal=on` and `wal_compression=on`. `DB_STORAGE_TYPE` selects the SSD profile (default) or `HDD`. - `POSTGRES_INITDB_ARGS` defaults to `--data-checksums` when unset. - `POSTGRES_EXTRA_OPTS` appends validated `name=value` settings. `hba_file` is rejected and always set last. - Immich-style `DB_*` variables fill the official `POSTGRES_*` names when those are empty. - Refuses data directories on network or shared-folder filesystems unless `IGNORE_DATABASE_FSTYPE=true`. - Main logic is guarded so the script can be sourced for testing. - **init_extensions.postgresql.sh**: creates `vchord` on first init when the switch is set, with the same guard. - **healthcheck.postgresql.sh** (new): runs `pg_isready` and fails if `pg_stat_database` reports any checksum failures. - **.dockerignore / Dockerfile**: copy and make executable the new healthcheck. - **README.md / AGENTS.md**: document the new switch, the server defaults, and the version pin. ## Why The Immich server needs VectorChord and its tuning profile. Checksums and the healthcheck make silent corruption visible. The storage and extra-options knobs let deployments tune without building a new image.
Add VectorChord extension with Immich profile and healthcheck
Some checks failed
ci / compose (pull_request) Successful in 12s
ci / shellcheck (pull_request) Successful in 2s
ci / conventions (pull_request) Failing after 1s
ci / image (pull_request) Successful in 1m8s
0bd5623bec
Make healthcheck.postgresql.sh executable
All checks were successful
ci / compose (pull_request) Successful in 12s
ci / shellcheck (pull_request) Successful in 2s
ci / conventions (pull_request) Successful in 2s
ci / image (pull_request) Successful in 42s
c706493e0c
Simplify postgresql-data volume mount syntax in README
All checks were successful
ci / compose (pull_request) Successful in 12s
ci / shellcheck (pull_request) Successful in 2s
ci / conventions (pull_request) Successful in 2s
ci / image (pull_request) Successful in 43s
a3cb5258ef
MHE merged commit 91b85a0729 into main 2026-11-01 14:38:24 +01:00
MHE deleted branch review-postgres-image-defaults-params 2026-11-01 14:39:05 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
openso/postgres!3
No description provided.