PostgreSQL 19 fixes#184
Open
devrimgunduz wants to merge 12 commits into
Open
Conversation
* unknown type name 'Datum'
In PostgreSQL 19, nodes/nodes.h (pulled in transitively via nodes/pg_list.h) added direct references to Datum in the outDatum()/readDatum() prototypes. In a frontend (client-side binary) build, Datum is only defined by postgres.h / postgres_fe.h — neither of which was included before the chain reached nodes/nodes.h. The fix adds a #if PG_VERSION_NUM >= 190000 branch that pulls in postgres_fe.h first, keeping the earlier PG 17/18 palloc.h path intact below it.
* 'PageXLogRecPtr' has no member named 'xlogid'
Prior to PostgreSQL 9.3, PageXLogRecPtr was a struct with two 32-bit fields {xlogid, xrecoff}. From 9.3 onward it became a uint64 typedef aliased to XLogRecPtr, and InvalidXLogRecPtr (== 0) is the correct sentinel. The old two-field comparison was simply never updated. The single-line replacement targetBlock->pd_lsn == InvalidXLogRecPtr is semantically identical and works on all supported major versions.
Coded by Claude AI
…ort-common.c, guarded by #if PG_VERSION_NUM >= 190000 and an include-once guard BTSPOOL_DEFINED. This way nbtsort-common.c no longer depends on nbtsort-19.c having already defined the struct — if nbtsort-19.c does define it (and also defines BTSPOOL_DEFINED), the duplicate is skipped; if it doesn't (as is evidently the case with your committed file), this definition fills the gap. The struct fields match the PG19 upstream definition exactly.
…9. Rather than hunting for which new header it landed in, an explicit extern declaration is the minimal and forward-compatible fix — the function itself still exists in the backend, it just lost its header declaration in the old location.
…ort-common.c. Your nbtsort-19.c already defines BTSpool properly, so this duplicate was redundant for gcc (which permits matching redefinitions) and broken for clang (which rejects them in the bitcode build).
PageXLogRecPtrGet's parameter changed from PageXLogRecPtr (by value) to const volatile PageXLogRecPtr * (by pointer) in PG19. This patch puts both call shapes behind a #if PG_VERSION_NUM >= 190000 guard so PG18 and earlier get the by-value form, PG19+ gets the pointer form.
…t they had external linkage with no prior declaration — which is exactly what -Wmissing-variable-declarations warns about. Marking them static gives them internal linkage and silences the warning. Not specific to PG19; it's a general cleanup that any modern gcc with this warning enabled will flag.
…ariable name (} static TYPES[] = ...), which is valid C but triggers -Wold-style-declaration because storage-class specifiers belong at the start of the declaration. This patch moves static to its correct position (before struct) for both TYPES and ALIASES.
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.
Hi,
These set of patches fixes compilation issues against v19. The commit messages are a bit dumb at some point, sorry about that. Regression test still need some love. so it'll leave to that to you.
These are mostly Claude patches (except a few obvious ones).
Per pgdg-packaging/pgdg-rpms#213