Skip to content

Add PostgreSQL 19 compatibility#654

Open
adeshthack wants to merge 1 commit into
percona:mainfrom
adeshthack:pg19-compat
Open

Add PostgreSQL 19 compatibility#654
adeshthack wants to merge 1 commit into
percona:mainfrom
adeshthack:pg19-compat

Conversation

@adeshthack
Copy link
Copy Markdown

Description:

PG19 introduces several API changes that break the build. This PR adds

C code changes (pg_stat_monitor.c, hash_query.c, pg_stat_monitor.h):

  • Adapt to planner_hook gaining ExplainState *es parameter
  • Handle QueryDesc->totaltime rename to QueryDesc->query_instr with
    executor-managed instrumentation lifecycle (query_instr_options)
  • Fix LWLockNewTrancheId() now requiring a name argument
  • Fix ShmemInitHash() dropping max_size parameter (5->4 args)
  • Handle const JumbleState* in post_parse_analyze_hook
  • Remove escape_string_warning (dropped from core_yy_extra_type)
  • Add missing #include headers guarded by PG_VERSION_NUM >= 190000

Test changes:

  • Add regression/expected/level_tracking_3.out for PG19
  • Add t/expected/007_settings_pgsm_query_shared_buffer.out.19
  • Add PG19 entry to t/018_column_names.pl

All changes use #if PG_VERSION_NUM >= 190000 / #else / #endif guards.
Tested against PG 19devel — all 22 regression tests and 34 TAP tests pass.

Links:
Related PostgreSQL 19 commits:

Upstream CI only tests PG 14-18:

PG19 introduces several API changes that break the build:

- planner_hook gains an ExplainState *es parameter
- QueryDesc->totaltime renamed to QueryDesc->query_instr with
  executor-managed instrumentation lifecycle (query_instr_options)
- LWLockNewTrancheId() now requires a name argument
- ShmemInitHash() drops the max_size parameter (5->4 args)
- post_parse_analyze_hook JumbleState parameter is now const-qualified
- escape_string_warning removed from core_yy_extra_type
- storage/shmem.h, storage/proc.h, utils/tuplestore.h no longer
  transitively included

All changes are guarded with #if PG_VERSION_NUM >= 190000 and have
zero impact on PG 14-18. Tested against PG 19devel with all 22
regression tests and 34 TAP tests passing.
@adeshthack adeshthack mentioned this pull request May 14, 2026
1 task
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