From 53286d88800b20325baa3254bbd98eeb693c8694 Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 19 May 2025 15:47:52 +0200 Subject: [PATCH] postgres_ffi: expose HeapTupleHeaderData --- libs/postgres_ffi/bindgen_deps.h | 2 ++ libs/postgres_ffi/build.rs | 3 +++ libs/postgres_ffi/src/lib.rs | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/postgres_ffi/bindgen_deps.h b/libs/postgres_ffi/bindgen_deps.h index 9da3f09b84..433dae07d2 100644 --- a/libs/postgres_ffi/bindgen_deps.h +++ b/libs/postgres_ffi/bindgen_deps.h @@ -12,3 +12,5 @@ #include "storage/bufpage.h" #include "storage/off.h" #include "access/multixact.h" +#include "postgres.h" +#include "access/htup.h" diff --git a/libs/postgres_ffi/build.rs b/libs/postgres_ffi/build.rs index cdebd43f6f..17b408a785 100644 --- a/libs/postgres_ffi/build.rs +++ b/libs/postgres_ffi/build.rs @@ -29,6 +29,7 @@ impl ParseCallbacks for PostgresFfiCallbacks { "CheckPoint", "FullTransactionId", "ControlFileData", + "HeapTupleHeaderData", ]; if serde_list.contains(&derive_info.name) { @@ -125,6 +126,8 @@ fn main() -> anyhow::Result<()> { .allowlist_var("PG_CONTROL_FILE_SIZE") .allowlist_var("PG_CONTROLFILEDATA_OFFSETOF_CRC") .allowlist_type("PageHeaderData") + .allowlist_type("HeapTupleHeaderData") + .allowlist_type("Datum") .allowlist_type("DBState") .allowlist_type("RelMapFile") .allowlist_type("RepOriginId") diff --git a/libs/postgres_ffi/src/lib.rs b/libs/postgres_ffi/src/lib.rs index 05d8de4c7a..f7c723027c 100644 --- a/libs/postgres_ffi/src/lib.rs +++ b/libs/postgres_ffi/src/lib.rs @@ -223,9 +223,9 @@ pub mod walrecord; // Export some widely used datatypes that are unlikely to change across Postgres versions pub use v14::bindings::{ - BlockNumber, CheckPoint, ControlFileData, MultiXactId, OffsetNumber, Oid, PageHeaderData, - RepOriginId, TimeLineID, TimestampTz, TransactionId, XLogRecPtr, XLogRecord, XLogSegNo, uint32, - uint64, + BlockNumber, CheckPoint, ControlFileData, HeapTupleHeaderData, MultiXactId, OffsetNumber, Oid, + PageHeaderData, RepOriginId, TimeLineID, TimestampTz, TransactionId, XLogRecPtr, XLogRecord, + XLogSegNo, uint32, uint64, }; // Likewise for these, although the assumption that these don't change is a little more iffy. pub use v14::bindings::{MultiXactOffset, MultiXactStatus};