v0.7.2
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 --lockedAPI Changes
-
Made
Date::to_unix_epoch_days()public by @osawyerr in #1039 -
Cleanup
PgTriggersuch that its public API can now be safe. by @eeeebbbbrrrr in #1055
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.
- overhaul our Postgres Range support by @eeeebbbbrrrr in #1050
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
IntoDatumimplementations for bothpg_sys::Pointandpg_sys::BOXby @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
FromDatumfor 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
- Remove plrust-related feature flags by @workingjubilee in #1053, Some cleanups around postgrestd and memctx handling by @thomcc in #1051
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}-devpackage 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/CARGOenvironment variables, and handle calls throughcargoincargo-pgxandpgx-testby @thomcc in #1038 -
Fix some warnings when the time-crate feature is disabled by @thomcc in #1054
New Contributors
- @sumerman made their first contribution in #1041
- @skyzh made their first contribution in #1044
- @JelteF made their first contribution in #1035
- @vadim2404 made their first contribution in #1056
Thanks everyone!
Full Changelog: v0.7.1...0.7.2