Skip to content

Add PostgreSQL 18 support (and drop EOL Debian 11 to fix CI) - #619

Open
pulse-mind wants to merge 2 commits into
ANXS:masterfrom
pulse-mind:feat/postgresql-18
Open

pulse-mind wants to merge 2 commits into
ANXS:masterfrom
pulse-mind:feat/postgresql-18

Conversation

@pulse-mind

Copy link
Copy Markdown
Contributor

Summary

Adds PostgreSQL 18 support, and makes CI green again by dropping Debian 11 (EOL).

Fixes #616. Supersedes #617 and #599 (see Relation to #617 below).

The PR has two commits so they can be reviewed separately:

  1. Drop Debian 11 (EOL) from supported platforms and CI
  2. Add PostgreSQL 18 support

1. Why Debian 11 is dropped

The scheduled CI on master has been red for weeks. The cause is only Debian 11:

  • Debian 11 "bullseye" reached end of LTS in August 2026. apt.postgresql.org no longer serves bullseye-pgdg (it moved to apt-archive.postgresql.org), and the debian-security packages installed by tests/prepare.yml now return 404.
  • The debian11 job therefore fails during prepare. The matrix uses fail-fast, so every other job gets cancelled in the middle of converge ("The strategy configuration was canceled because molecule.debian11 failed"). The other distros are not actually broken.

This commit follows the pattern used when Ubuntu 20.04 was removed (#603). It removes debian11 from the CI matrix, from the README compatibility matrix, from the meta/main.yml platforms (bullseye) and from the Molecule docs. It deletes tests/vars.Debian.11.yml and changes the default MOLECULE_DISTRO from debian11 to debian12.

2. PostgreSQL 18 support

How the template was built

  • templates/postgresql.conf-18.orig is the postgresql.conf.sample shipped by the PGDG 18.0 package. listen_addresses is restored to its packaged value, because the official Docker image patches it. I used 18.0 rather than the latest minor on purpose: the template must work with every 18.x. Later minors added settings (file_extend_method, output_plugin_libraries) that 18.0 rejects.
  • templates/postgresql.conf-18.j2 comes from a 3-way merge: base 17.orig, ours 17.j2, theirs 18.orig. As a result, diff 17.j2 18.j2 mirrors diff 17.orig 18.orig, which should make review straightforward. As in 17, every setting of the sample is templated, except include*.

Changes in PostgreSQL 18 handled by the template

Change Handling
New settings: io_method, io_workers, io_max_concurrency, io_max_combine_limit, file_copy_method, autovacuum_worker_slots, autovacuum_vacuum_max_threshold, vacuum_truncate, vacuum_max_eager_freeze_failure_rate, idle_replication_slot_timeout, max_active_replication_origins, enable_distinct_reordering, enable_self_join_elimination, log_lock_failures, track_cost_delay_timing, md5_password_warnings, oauth_validator_libraries, ssl_tls13_ciphers, extension_control_path Templated, with new postgresql_* variables in defaults/main.yml set to the upstream defaults and tagged # (>= 18)
ssl_ecdh_curve renamed to ssl_groups New postgresql_ssl_groups variable (upstream default X25519:prime256v1)
extension_destdir removed: the Debian patch that provided it is gone in 18 Not rendered for 18. PostgreSQL 18 refuses to start with it: FATAL: unrecognized configuration parameter "extension_destdir"
log_connections is now a list (receipt, authentication, authorization, setup_durations, all) Backward compatible: postgresql_log_connections still accepts a boolean, and now also a string or a list
effective_io_concurrency and maintenance_io_concurrency defaults change to 16 Version-dependent defaults, following the same pattern as hash_mem_multiplier. No change for 13 to 17.
Vacuum settings regrouped under a new VACUUMING section Same layout as the upstream sample

Other changes

  • vars/postgresql_18.yml placeholder, same as for 16 and 17.
  • postgresql_postgis_release_compatibility: 18: "3.6", the first PostGIS release that supports PostgreSQL 18.
  • Molecule: new postgresql-18 instance.
  • README: new PostgreSQL 18 column. Debian 11 is not listed because it is dropped. Rocky Linux stays :warning: because it is not tested in CI.
  • molecule/README.md: updated the tested versions and removed a leftover ======= merge marker.

Deliberately not changed

  • The default postgresql_version stays 17. Bumping it would make the next run of the role on an existing server install PostgreSQL 18 and create a second, empty cluster next to the 17 one. The role does not run pg_upgrade. This seems better done in a separate, explicitly breaking change.

Testing

Molecule (molecule -v test, the same command as CI)

Each run creates 6 containers (PostgreSQL 13, 14, 15, 16, 17 and 18) and runs create → prepare → converge → idempotence → destroy.

Distro PG 13–17 PG 18 Idempotence
Debian 12 ✅ ✅ ✅ changed=0
Debian 13 ✅ ✅ ✅ changed=0
Ubuntu 22.04 ✅ ✅ ✅ changed=0
Ubuntu 24.04 ✅ ✅ ✅ changed=0

Toolchain pinned like CI: Python 3.12, ansible>10,<12 (ansible-core 2.18.20), molecule 26.11.0, molecule-plugins[docker], geerlingguy images. I ran this locally on an arm64 Docker host; CI runs on amd64. yamllint . passes.

Template checked against real PostgreSQL 18 binaries

I rendered postgresql.conf-18.j2 with the role defaults and with several log_connections variants (false, true, "receipt,authentication", [authorization, setup_durations], all), then loaded each render with PostgreSQL 18.0 and 18.7 (PGDG packages). Every variant was accepted, the server started, and pg_settings showed the expected values. Examples: io_method=worker, effective_io_concurrency=16, ssl_groups=X25519:prime256v1, autovacuum_worker_slots=16.

I also checked the opposite case. With the 17 template's extension_destdir line, PostgreSQL 18 refuses to start.

Also tested: Ubuntu 26.04 (not added to the matrix here)

Ubuntu 26.04 ships PostgreSQL 18 by default. With the same Molecule setup (MOLECULE_DISTRO=ubuntu2604, resolute-pgdg) and an empty tests/vars.Ubuntu.26.yml, converge and idempotence pass (changed=0) for PostgreSQL 13 to 18. That run used the same ansible-core 2.18 against the image's Python 3.14. I'll propose adding Ubuntu 26.04 to the CI matrix in a separate PR to keep this one focused.

Out of scope / known issues

  • The PostGIS package names built in defaults/main.yml (postgresql-<pg>-postgis-<x.y>) do not match the names PGDG publishes (postgresql-<pg>-postgis-3). This also affects 17 (see PostGis fails on Ubuntu 24 (Jammy) #600) and is left for a separate fix.

Relation to #617

Thanks to the author of #617 for pushing this forward. That PR has two problems that this one avoids:

  • Its postgresql.conf-18.j2 still renders extension_destdir = '...' uncommented, so PostgreSQL 18 does not start on Debian/Ubuntu (FATAL: unrecognized configuration parameter "extension_destdir"). Its CI never ran, so this was not caught.
  • It changes the default postgresql_version to 18, which affects existing deployments (see above).

This PR also comes with the CI fix, so it can show green checks.

🤖 Generated with Claude Code

pulse-mind and others added 2 commits November 19, 2026 09:59
Debian 11 "bullseye" reached end of LTS in August 2026:
- apt.postgresql.org no longer publishes the bullseye-pgdg suite (moved to apt-archive)
- debian-security packages used by tests/prepare.yml now return 404

The debian11 Molecule job therefore fails during prepare, and since the
matrix uses fail-fast, every other distro job gets cancelled, which keeps
the whole CI red on master.

Remove debian11 from the CI matrix, the compatibility matrix, galaxy
platforms and the Molecule docs, and use debian12 as the default Molecule
distro.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- templates/postgresql.conf-18.orig: postgresql.conf.sample shipped by the
  PGDG 18.0 package (listen_addresses restored, as the Docker image patches it)
- templates/postgresql.conf-18.j2: derived from postgresql.conf-17.j2 by a
  3-way merge of the 17 -> 18 sample changes, so `diff 17.j2 18.j2` mirrors
  `diff 17.orig 18.orig`:
  - new settings templated: io_method, io_workers, io_max_concurrency,
    io_max_combine_limit, file_copy_method, autovacuum_worker_slots,
    autovacuum_vacuum_max_threshold, vacuum_truncate,
    vacuum_max_eager_freeze_failure_rate, idle_replication_slot_timeout,
    max_active_replication_origins, enable_distinct_reordering,
    enable_self_join_elimination, log_lock_failures, track_cost_delay_timing,
    md5_password_warnings, oauth_validator_libraries, ssl_tls13_ciphers,
    extension_control_path
  - ssl_ecdh_curve renamed to ssl_groups
  - vacuum cost/freezing settings moved to the new VACUUMING section
  - extension_destdir removed: the Debian patch providing it is gone in 18
    and PostgreSQL 18 refuses to start with it ("unrecognized configuration
    parameter")
  - log_connections keeps accepting a boolean, and also accepts a string or
    a list (receipt, authentication, authorization, setup_durations, all)
- defaults: new variables, PG18 defaults for effective_io_concurrency and
  maintenance_io_concurrency (16) only when postgresql_version >= 18,
  PostGIS 3.6 for 18
- molecule: add a postgresql-18 instance
- postgresql_version default is unchanged (17), so existing deployments are
  not silently switched to a new major version

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@pulse-mind

Copy link
Copy Markdown
Contributor Author

Since workflows from forks need maintainer approval here, I ran the same CI workflow on my fork: all jobs pass (Yamllint + Molecule on debian12, debian13, ubuntu2204, ubuntu2404, PostgreSQL 13 to 18 with idempotence):
https://github.com/pulse-mind/ansible-anxs-postgresql/actions/runs/44493684576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL 18 support

2 participants