feat(postgres): Upgrade pgrx to 0.16 with pg17/pg18 support #112
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.
Summary
extern "C"toextern "C-unwind"for pg_guard functionsProblem
The previous pgrx 0.12 configuration declared pg17 support, but pgrx 0.12 only supports pg14-16. This caused build failures when attempting to build with pg17.
Solution
Upgraded to pgrx 0.16 which properly supports pg17 and pg18. This required:
#[pg_guard]functions must useextern "C-unwind"instead ofextern "C"c"...")select()params changed fromNoneto&[]amcanbuildparallel,aminsertcleanupamcanhash,amconsistentequality,amconsistentordering,amgettreeheight,amtranslatestrategy,amtranslatecmptypeFiles Changed
Test Plan
cargo check --features pg17passescargo build --lib --features pg17 --releaseproduces libruvector_postgres.dylib (3.3MB)macOS Build Note
On macOS, building requires linker flags for PostgreSQL symbol resolution:
RUSTFLAGS="-C link-arg=-undefined -C link-arg=dynamic_lookup" \ cargo build --lib --no-default-features --features pg17 --release🤖 Generated with Claude Code