Fix build against PostgreSQL 19 - #27
Open
devrimgunduz wants to merge 1 commit into
Open
Conversation
plprofiler.h:
* PG19's header include-what-you-use (IWYU) cleanup means
<storage/lwlock.h>, <storage/shmem.h> and <utils/tuplestore.h>
are no longer pulled in transitively by the headers plprofiler.h
already included. Without them, LWLockAcquire/LWLockRelease,
RequestAddinShmemSpace/RequestNamedLWLockTranche, ShmemInitStruct/
ShmemInitHash/GetNamedLWLockTranche and tuplestore_begin_heap/
tuplestore_putvalues were all implicitly declared, producing the
"call to undeclared function" / "incompatible integer to pointer
conversion" errors seen on both clang (LLVM bitcode build) and
gcc. Add the three missing includes to plprofiler.h.
* profilerSharedState.lock was declared as "LWLockId", a typedef
that was removed from PostgreSQL back in 9.4 when LWLocks moved
to a pointer-based API. The plprofiler code itself already treats
plpss->lock as a pointer (e.g.
"plpss->lock = &(GetNamedLWLockTranche(...))->lock;"), so the
struct member had been silently relying on an implicit int-to-
pointer conversion that recent compilers (and C99+) no longer
allow. Change the member to the correct "LWLock *" type.
plprofiler.c:
* PG19 changed the signature of ShmemInitHash() from
HTAB *ShmemInitHash(const char *name, long init_size,
long max_size, HASHCTL *infoP,
int hash_flags);
to
HTAB *ShmemInitHash(const char *name, int64 nelems,
HASHCTL *infoP, int hash_flags);
collapsing the separate init_size/max_size arguments into a
single nelems argument. Both call sites in profiler_shmem_startup()
(for the "plprofiler functions" and "plprofiler callgraph" shared
hash tables) were passing the old 5-argument form, which now fails
to compile ("too many arguments to function call" / argument-type
mismatches). Drop the redundant init_size argument at both call
sites so only one size argument (nelems) is passed.
Hacked by Claude, tested by me.
Contributor
|
kewl
…On Fri, Jul 10, 2026 at 5:02 AM Devrim Gündüz ***@***.***> wrote:
plprofiler.h:
- PG19's header include-what-you-use (IWYU) cleanup means
<storage/lwlock.h>, <storage/shmem.h> and <utils/tuplestore.h> are no
longer pulled in transitively by the headers plprofiler.h already included.
Without them, LWLockAcquire/LWLockRelease,
RequestAddinShmemSpace/RequestNamedLWLockTranche, ShmemInitStruct/
ShmemInitHash/GetNamedLWLockTranche and tuplestore_begin_heap/
tuplestore_putvalues were all implicitly declared, producing the "call to
undeclared function" / "incompatible integer to pointer conversion" errors
seen on both clang (LLVM bitcode build) and gcc. Add the three missing
includes to plprofiler.h.
- profilerSharedState.lock was declared as "LWLockId", a typedef that
was removed from PostgreSQL back in 9.4 when LWLocks moved to a
pointer-based API. The plprofiler code itself already treats plpss->lock as
a pointer (e.g. "plpss->lock = &(GetNamedLWLockTranche(...))->lock;"), so
the struct member had been silently relying on an implicit int-to- pointer
conversion that recent compilers (and C99+) no longer allow. Change the
member to the correct "LWLock *" type.
plprofiler.c:
- PG19 changed the signature of ShmemInitHash() from HTAB
*ShmemInitHash(const char *name, long init_size, long max_size, HASHCTL
*infoP, int hash_flags); to HTAB *ShmemInitHash(const char *name, int64
nelems, HASHCTL *infoP, int hash_flags); collapsing the separate
init_size/max_size arguments into a single nelems argument. Both call sites
in profiler_shmem_startup() (for the "plprofiler functions" and "plprofiler
callgraph" shared hash tables) were passing the old 5-argument form, which
now fails to compile ("too many arguments to function call" / argument-type
mismatches). Drop the redundant init_size argument at both call sites so
only one size argument (nelems) is passed.
Hacked by Claude, tested by me.
Per pgdg-packaging/pgdg-rpms#213
<pgdg-packaging/pgdg-rpms#213>
------------------------------
You can view, comment on, or merge this pull request online at:
#27
Commit Summary
- 8e9173e
<8e9173e>
Fix build against PostgreSQL 19
File Changes
(2 files <https://github.com/bigsql/plprofiler/pull/27/files>)
- *M* plprofiler.c
<https://github.com/bigsql/plprofiler/pull/27/files#diff-60116c4d2aebd136948b7c18a16861854e322b9b0449757118aabd99a81513c7>
(2)
- *M* plprofiler.h
<https://github.com/bigsql/plprofiler/pull/27/files#diff-0978dd799f513cf12a996eaadfb8a216766610437dbab99a0eecc85a8f17e7b5>
(5)
Patch Links:
- https://github.com/bigsql/plprofiler/pull/27.patch
- https://github.com/bigsql/plprofiler/pull/27.diff
—
Reply to this email directly, view it on GitHub
<#27?email_source=notifications&email_token=AAMWOHRVY3YG34HLM76NSDL5ECWL7A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DAMRYGEZTAOBQGGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMWOHWID4GGTKOYKWNTXUD5ECWL7AVCNFSNUABFKJSXA33TNF2G64TZHMZDCOBTG4YDMNZQHNEXG43VMU5TIOBVGM3DANBVHA4KC5QC>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
is there any update on pg19 compatibility? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
plprofiler.h:
plprofiler.c:
Hacked by Claude, tested by me.
Per pgdg-packaging/pgdg-rpms#213