github pgcentralfoundation/pgrx v0.12.0-beta.0

latest releases: v0.12.8, v0.12.7, v0.12.6...
pre-release4 months ago

Hello!

In pgrx 0.12.0-beta.0, the first news of import is that if you run

cargo install cargo-pgrx --version 0.12.0-beta.0 --locked

You should then be able to run

cargo pgrx upgrade 0.12.0-beta.0

in your project to update all of the versions of pgrx libraries in your project's Cargo.tomls. Please let us know how it goes!

Many cargo-pgrx updates and modifications

Internal improvements

  • @usamoi made most of our generated bindings #[inline] in #1616 which will defer codegen until the FFI guard is actually used, which should improve build times considerably
  • Memory management for Datum to String conversion by @sardination in #1684 should reduce allocations
  • Use Ceescape's sigsetjmp() wrapper by @NotGyro in #1621 takes care of a UB concern where sigsetjmp and siglongjmp aren't concepts that can be reflected in Rust code, and thus must be called when Rust "isn't looking": inside asm!. Without this, these calls may be miscompiled, because LLVM may strip the "returns-twice" codegen annotation from them.
  • @JelteF fixed an odd case where OnceLock improperly modeled the lifetime of a Postgres extension, which may persist between resets of the server by using UnsafeCell for PgLwLock and PgAtomic in #1696

New API

Time breakage

Several of our datetime APIs were incorrect in various ways. On the positive side, the remaining functions should no longer panic.

New FFI bindings

We have added many more bindings to the cshim and pgrx-pg-sys!

Breakage of many functions

The pgrx::srf module, which contained no visible code, is no longer accessible.

A number of changes in a hidden module have been done, in conjunction with alterations to the supporting code that #[pg_extern] generates, to make the process of "unboxing" arguments and "boxing" returns... transforming them to and from Datums, specifically at function boundaries... sound. If your code has been broken, it either is a rare and specific SetOfIterator or TableIterator type or it was probably unsound, especially if it used the 'static lifetime. Please report any unexpected breakages.

Fortunately, this has upsides beyond just soundness: now lifetimes in pgrx functions should simply work, and work correctly.

The PRs of interest:

Documentation improvements

If you use mdbook you can generate our documentation. Unfortunately it isn't published yet. We've been making various small improvements to it.

Span adjustments for diagnostics/linting

A number of fixes have been done to how pgrx generates code so that the code should now be detectable as macro-expanded code while still pointing to the appropriate code in errors. There are still diagnostic improvements to be had and this is not done uniformly across all of pgrx yet, so please report if there are issues with these.

Deprecations

A number of things have been deprecated gracefully rather than simply unceremoniously dumped.

New Contributors

Full Changelog: v0.12.0-alpha.1...v0.12.0-beta.0

Don't miss a new pgrx release

NewReleases is sending notifications on new releases.