Fix wal2mongo build failures against PostgreSQL 17, 18, and 19.#6
Fix wal2mongo build failures against PostgreSQL 17, 18, and 19.#6devrimgunduz wants to merge 1 commit into
Conversation
PG 17 / 18: - change->data.tp.newtuple and oldtuple changed type from ReorderBufferTupleBuf * (requiring ->tuple dereference to obtain HeapTupleData) to bare HeapTuple. Drop the ->tuple member access and pass the pointer directly to tuple_to_stringinfo() for all five call sites (INSERT, UPDATE old/new/pkAttrs, DELETE). PG 19: - RepOriginId renamed to ReplOriginId; InvalidRepOriginId renamed to InvalidReplOriginId. Update forward declaration, function definition, and the only_local guard accordingly. - AssertVariableIsOfType() removed; replace with StaticAssertVariableIsOfType() which performs the same check at compile time. - VARATT_IS_EXTERNAL_ONDISK(), VARSIZE_ANY_EXHDR(), and VARDATA_ANY() now take const void * instead of accepting Datum implicitly. Wrap the Datum arguments with DatumGetPointer() at the three affected call sites. All versions: - Remove always-true (valptr+1) != NULL guard in print_w2m_literal(). Pointer arithmetic on a non-null pointer never yields NULL; the compiler correctly warns about this. The *(valptr+1) read is safe regardless: the loop iterates while *valptr != '\0', so valptr+1 is always within the string or pointing at the null terminator, neither of which requires a NULL check. All changes are guarded with appropriate #if PG_VERSION_NUM >= NNNNNN blocks to preserve backwards compatibility with PG 13-16.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesPostgreSQL version compatibility
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PG 17 / 18:
PG 19:
All versions:
All changes are guarded with appropriate #if PG_VERSION_NUM >= NNNNNN blocks to preserve backwards compatibility with PG 13-16.
pgdg-packaging/pgdg-rpms#213
Summary by CodeRabbit