Skip to content

Support PostgreSQL 14-18, add regression suite and CI - #7

Merged
Xof merged 1 commit into
masterfrom
modernize-pg14-18-ci
Jul 21, 2026
Merged

Support PostgreSQL 14-18, add regression suite and CI#7
Xof merged 1 commit into
masterfrom
modernize-pg14-18-ci

Conversation

@Xof

@Xof Xof commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Brings the module from its last compatibility target (PostgreSQL 13) up to the full set of upstream-supported majors, and adds a CI pipeline.

Code (plan_filter.c)

  • Requires PostgreSQL 14+ (compile-time #error below that); the pre-13 planner-hook compatibility macros are gone since the 13+ hook signature is universal in the supported window
  • _PG_fini removed — PostgreSQL 15 removed library unloading, and it was unreachable before that
  • The plan_filter. GUC prefix is reserved (MarkGUCPrefixReserved on 15+, EmitWarningsOnPlaceholders on 14), so a misspelled setting now errors instead of silently leaving the filter off
  • PG_MODULE_MAGIC_EXT with module name/version on 18+, plain magic earlier
  • Fixed a typo in the error hint

Tests

  • The manual testlimit.sql (100M-row table, no pass/fail) is replaced by a pg_regress suite run via make installcheck
  • All assertions are behavioral and no cost numbers appear in the output, so a single expected file serves every supported major on every platform
  • Covers: limit off/exceeded, cheap statements passing, EXPLAIN being blocked, the SET LOCAL escape hatch and its expiry, filter_select_only both ways, and SUSET enforcement of both GUCs
  • The suite pins both GUCs right after LOAD, so it also passes against clusters that preload the module with a limit configured

CI (.github/workflows/ci.yml)

  • Gating: build with -Werror + installcheck on PostgreSQL 14, 15, 16, 17, and 18 (pgdg packages, self-owned throwaway cluster per job); cppcheck static analysis
  • Report-only: pgbench overhead benchmark (module absent vs. loaded with an unreached limit), published to the job summary and kept as an artifact; continue-on-error because shared-runner numbers are too noisy to gate on
  • GITHUB_TOKEN restricted to contents: read

Docs

  • README: fixed filter_select_only being documented under a nonexistent name (limit_select_only), documented the supported-version policy and testing, removed pre-9.2 material, added the CI badge
  • Decision records in docs/adr/ (support window, test design, CI design) and a new ARCHITECTURE.md

Testing

  • Build is warning-free and installcheck passes on PostgreSQL 14-18 in an ubuntu:24.04 rehearsal of the exact CI steps — each version tested against both a pristine cluster and one preconfigured with session_preload_libraries and a cost limit — and on PostgreSQL 18.3 on macOS
  • The cppcheck invocation and the benchmark harness were verified in the same rehearsal (bench also on macOS, leaving no temp directories behind)

- Require PostgreSQL 14+; drop the pre-13 planner-hook compatibility
  macros and the unreachable _PG_fini callback
- Reserve the plan_filter. GUC prefix (MarkGUCPrefixReserved on 15+) so
  a misspelled setting errors instead of silently disabling the filter
- Use PG_MODULE_MAGIC_EXT with a module name and version on 18+
- Replace the manual testlimit.sql with a pg_regress suite wired up as
  make installcheck; assertions are behavioral and the expected output
  is version-independent, so one file serves all supported majors
- Add GitHub Actions CI: build with -Werror and run installcheck
  against PostgreSQL 14-18 pgdg packages, cppcheck static analysis,
  and a report-only pgbench benchmark with results kept as artifacts
- Fix README documentation of filter_select_only (was documented under
  a nonexistent name); document supported versions and testing
- Record the decisions as ADRs 0001-0003; add ARCHITECTURE.md
@Xof
Xof merged commit ae6cb12 into master Jul 21, 2026
7 checks passed
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.

1 participant