github pgcentralfoundation/pgrx v0.7.2

latest releases: v0.12.8, v0.12.7, v0.12.6...
20 months ago

This is pgx v0.7.2. It contains quite a few bugfixes and API changes (some of which are breaking).

When updating please make sure to update your crate dependencies and also:

$ cargo install cargo-pgx --version 0.7.2 --locked

API Changes

There's quite a bit of changes to trigger support. PgTrigger is now parameterized with a lifetime and #[pg_trigger] functions will need to adapt to this. Additionally, #[pg_trigger] functions must now return an Option<PgHeapTuple>> (or Result<Option<PgHeapTuple>, E>) as previously it wasn't possible to return a NULL tuple (ie, Option::None), indicating that the row being acted upon should not be modified.

Range support has been changed quite a bit to be more ergonomic and provide conversion from Rust std::ops::Range* types. Check out the new example in pgx-examples/range/.

  • a better Error type when conversion from Date to time::Date doesn't work by @eeeebbbbrrrr in #1052

This is only relevant when the pgx/time-crate feature is used

Correctness Issues

  • By default, require superuser privileges to install a pgx extension by @vadim2404 in #1056

This only impacts new extension crates made with cargo pgx new. It's better that pgx assume the extension you're about to make is wildly unsafe and for you to change that assumption in its extname.control file if you disagree.

  • Fix the IntoDatum implementations for both pg_sys::Point and pg_sys::BOX by @eeeebbbbrrrr in #1042

  • Extend UTF-8 detection in PGX init and test by @sumerman in #1041

Bug Fixes

pgx extensions can now be built against Postgres forks, but you'll need to turn on the pgx/unsafe-postgres feature for your pgx dependency.

  • Use SPITupleTable->numvals when available by @yrashk in #1037

  • Support in FromDatum for binary coercible types (including domain types) by @EdMcBane in #1028

This allows slightly more automatic conversions between data types for Spi. Especially when the Postgres type is a DOMAIN over something like TEXT and the desired Rust type is a String

pgx no longer knows that it's being used with postgrestd

cargo pgx init no longer assumes a user named "root" exists on the system

Miscellaneous

If you run Postgres or cargo pgx run with RUST_BACKTRACE=1 set in the environment, then whenever pgx catches a panic, it'll include a full backtrace!

  • Ensure the libpq{,N}-dev package is removed in CI by @thomcc in #1034

  • Fix outdated documentation for pgx::name! by @Smittyvb in #1036

  • Disable thin lto for dev builds by default in template by @JelteF in #1035

  • Respect RUSTC/CARGO environment variables, and handle calls through cargo in cargo-pgx and pgx-test by @thomcc in #1038

  • Fix some warnings when the time-crate feature is disabled by @thomcc in #1054

New Contributors

Thanks everyone!

Full Changelog: v0.7.1...0.7.2

Don't miss a new pgrx release

NewReleases is sending notifications on new releases.