Skip to content

feat: choose the PostgreSQL version with PG - #13

Merged
holmboe merged 2 commits into
mainfrom
postgres-versions
Oct 14, 2026
Merged

holmboe merged 2 commits into
mainfrom
postgres-versions

Conversation

@holmboe

@holmboe holmboe commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Like phabfive picks the PHP for each Phorge version, noodle now picks the PostgreSQL next to the Odoo version:

make reset && make up VERSION=19 PG=min   # oldest PostgreSQL Odoo 19 supports
make reset && make up PG=18
  • PG is a major version or min, empty is the default (the postgres:17 tag in k8s/base/postgres.yaml). The last one is remembered in .k8s/postgres, so a new default does not break existing data.
  • scripts/postgres-version.sh reads odoo.release.MIN_PG_VERSION from the built image and refuses an older PG (Odoo itself only warns). No version table to maintain.
  • Data of another major version is refused by make deploy while postgres runs, and by a new check-version init container on start, both asking for make reset.
  • The volume is mounted at /var/lib/postgresql with the data in pgdata/, the layout postgres:18 and later expect. Existing volumes already have their data in pgdata/, so they keep working.
  • make ps shows the PostgreSQL version, test_postgres_version checks the server Odoo talks to.
  • Renovate notes that a new postgres major only applies after make reset.

CI

  • Pull requests: the ci:odoo-* versions, each on every ci:postgres-<major> label (default PostgreSQL without one).
  • Weekly and manual runs: every Odoo build on the default, min and 18.

The ci:postgres-* labels do not exist in the repo yet.

Testing

  • pre-commit run --all-files and make validate pass.
  • postgres-version.sh against Odoo 20: empty → 17, min → 16, 18 → 18, 13 and abc are refused.
  • The generated kustomization with PG=18 sets postgres:18 on both the init container and postgres.
  • In throwaway Docker volumes: postgres:18 initializes with the new layout, the version check passes on empty and matching data and stops postgres:17 on 18 data.
  • CI with ci:odoo-19, ci:odoo-20, ci:postgres-16, ci:postgres-17 and ci:postgres-18: all 6 pairs deploy the requested PostgreSQL and pass make ci-test, including test_postgres_version.
  • Not run: switching PG on an existing local volume (the deploy and init container refusal), only checked with throwaway Docker volumes.

🤖 Generated with Claude Code

`make up PG=18` runs Odoo on that PostgreSQL major version, `PG=min` on
the oldest the built Odoo supports (odoo.release.MIN_PG_VERSION, below
which Odoo only warns). The default stays the postgres:17 tag in
k8s/base/postgres.yaml, the last PG is remembered in .k8s/postgres.

Data of another major version is refused by `make deploy` while postgres
runs and by a check-version init container on start, asking for
`make reset`. The volume moves to /var/lib/postgresql with the data in
pgdata/, the layout of postgres:18 and later, existing volumes keep
working.

CI runs the ci:odoo-* versions on each ci:postgres-<major> label, and
the weekly run every build on the default, min and 18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

holmboe has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@holmboe holmboe added ci:postgres-16 Test PostgreSQL 16 in CI on this pull request ci:postgres-18 Test PostgreSQL 18 in CI on this pull request labels Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

holmboe has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@holmboe holmboe added ci:odoo-19 Test Odoo 19 in CI on this pull request ci:odoo-20 Test Odoo 20 in CI on this pull request ci:postgres-17 Test PostgreSQL 17 in CI on this pull request labels Oct 14, 2026
@holmboe
holmboe merged commit c2c51eb into main Oct 14, 2026
12 of 14 checks passed
@holmboe
holmboe deleted the postgres-versions branch October 14, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:odoo-19 Test Odoo 19 in CI on this pull request ci:odoo-20 Test Odoo 20 in CI on this pull request ci:postgres-16 Test PostgreSQL 16 in CI on this pull request ci:postgres-17 Test PostgreSQL 17 in CI on this pull request ci:postgres-18 Test PostgreSQL 18 in CI on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant