v0.11.0
Welcome to pgrx v0.11.0. It's a new "major" release with some new features, a faster "build.rs", and some bugfixes.
As always, please update by running cargo install cargo-pgrx --version 0.11.0 --locked
and update your extension crate Cargo.toml
files accordingly.
What's Changed
Faster Buildings
@workingjubilee did some work to improve build times. As measured on their computer against cargo check
, it's roughly a quarter faster. In doing so, the generated "bindings.rs" files look a little different and our "build.rs" has been cleaned up a bit.
- Make check builds ~25% faster by merging extern blocks by @workingjubilee in #1316
- Touch up Display for PgNode by @workingjubilee in #1313
- Consistently order generated impls by @workingjubilee in #1314
- Organize bindgen arg sets in fn (nfc) by @workingjubilee in #1312
- Check for
is_for_release
once by @workingjubilee in #1315 - Report build versions that conflict by @workingjubilee in #1310
Pure Rust implementation for PgList
@workingjubilee did a tremendous amount of work creating a proper wrapper around Postgres' internal List
type, called PgList
.
- Introduce pure-Rust replacement for PgList by @workingjubilee in #1277
- Remove incorrect List::drain assert by @workingjubilee in #1283
- when constructing a new ListCell, the 'next' node begins life as NULL by @eeeebbbbrrrr in #1285
- Fix some List sizing bugs by @workingjubilee in #1289
- Actually use repalloc return in List by @workingjubilee in #1291
- Rename node_list.rs -> linked_list.rs by @workingjubilee in #1286
Some background here is that we intend to add the "dynamic function call" work (see below) to PL/Rust. In doing that work, use of Postgres' List
type is pretty important and pgrx' existing implementation was a) mostly in the cshim, and b) just not very-good-and-sound. Considering (b) and also that PL/Rust isn't able to use anything from pgrx' chsim (a), @workingjubilee set out to make a proper Rust wrapper/implementation of Postgres' List
type.
Note: As part of this, NodeTag
is now a proper enum
, which requires a small migration which is mostly satisfied by a regex-based find-replace of NodeTag_T_[A-Za-z]*
with NodeTag::T_$1
.
More Bindings
We've added more Postgres internals headers to the pgrx-pg-sys
crate:
- Generate bindings for WAL recovery functions by @feikesteenbergen in #1294
- Include bindings for controlfile by @feikesteenbergen in #1320
- Bind catalog header definitions for access method tables by @workingjubilee in #1306
Dynamic Function Calling
pgrx now allows calling any SQL-defined function (ie, via CREATE FUNCTION
) in a (mostly) Rusty way with the new dynamic function calling support. Some documentation around this feature can be found in the sources, here and in the unit tests.
- Dynamic function call by @eeeebbbbrrrr in #1279
As mentioned above, this feature will be exposed in PL/Rust soon. However, it's still an extremely powerful feature for pure pgrx extensions as it allows calling another function directly, with runtime type safety checks, without incurring any Spi overhead.
cargo pgrx install --sudo
Sometimes cargo-pgrx install
can be tough to work with if targeting a package manager-managed Postgres installation as the various extension directories are owned by root. cargo pgrx install --sudo
fixes that by copying the files as root. The build, which is typically done as a regular user, is still run by that user -- only the file copying is run with sudo
.
- Add
cargo pgrx install --sudo
by @eeeebbbbrrrr in #1322
Miscellaneous Work
- Replace cshimmed fn by @workingjubilee in #1304
- Enable proptest in more workflows by @workingjubilee in #1309
- Float Dockerfile's Fedora version by @workingjubilee in #1311
- Fix pg16 CI by @eeeebbbbrrrr in #1326
Thanks!
Thanks to all the contributors! We appreciate the PRs and testing. And we especially like hearing about what you're building with pgrx.
Full Changelog: v0.10.2...v0.11.0