Skip to content

Add PostgreSQL 19 compatibility #655

Description

@adeshthack

Description

Summary

pg_stat_monitor fails to build against PostgreSQL 19 (19devel) due to several API changes. The
current CI matrix covers PG 14-18 only.

Build Failures

The following PG19 API changes break compilation:

  1. planner_hook signature change — now takes an additional ExplainState *es parameter
  2. QueryDesc->totaltime renamed to QueryDesc->query_instr — PG19 manages the
    InstrStart/InstrStop lifecycle automatically via query_instr_options
  3. LWLockNewTrancheId() now requires a name argument
  4. ShmemInitHash() dropped the max_size parameter (5->4 args)
  5. escape_string_warning removed from core_yy_extra_type
  6. Missing transitive includes — storage/shmem.h, storage/proc.h, utils/tuplestore.h must
    be explicitly included

Test Failures

  • level_tracking regression test needs an alternate expected output for PG19 (immutable SQL
    functions inlined at plan time)
  • 018_column_names.pl TAP test needs a PG19 column list entry
  • 007_settings_pgsm_query_shared_buffer TAP test needs a .out.19 expected output variant

Fix

PR with full fix: #654

All changes use #if PG_VERSION_NUM >= 190000 / #else / #endif guards. Zero impact on PG
14-18. All 22 regression tests and 34 TAP tests pass.

Suggested solution

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions