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.
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:
API Changes
Made
Date::to_unix_epoch_days()
public by @osawyerr in Made Date::to_unix_epoch_days() public #1039Mapping PG interval type by @mhov in Mapping PG interval type #629
Cleanup
PgTrigger
such that its public API can now be safe. by @eeeebbbbrrrr in CleanupPgTrigger
such that its public API can now be safe. #1055There'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 anOption<PgHeapTuple>>
(orResult<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/.This is only relevant when the
pgx/time-crate
feature is usedCorrectness Issues
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 itsextname.control
file if you disagree.Fix the
IntoDatum
implementations for bothpg_sys::Point
andpg_sys::BOX
by @eeeebbbbrrrr in Fix theIntoDatum
implementations for bothpg_sys::Point
andpg_sys::BOX
#1042Extend UTF-8 detection in PGX init and test by @sumerman in Extend UTF-8 detection in PGX init and test #1041
Bug Fixes
fix for Aggregates incorrectly schema STYPE when using a schema #797 aggregate schemas by @mhov in fix for #797 aggregate schemas #1027
Fix issue NeonDatabase, based on pg15, can't load pgx extensions #1032 by @eeeebbbbrrrr in Fix issue #1032 #1033
pgx extensions can now be built against Postgres forks, but you'll need to turn on the
pgx/unsafe-postgres
feature for yourpgx
dependency.Use SPITupleTable->numvals when available by @yrashk in Use SPITupleTable->numvals when available #1037
Support in
FromDatum
for binary coercible types (including domain types) by @EdMcBane in Support inFromDatum
for binary coercible types (including domain types) #1028This 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 Stringpgx no longer knows that it's being used with
postgrestd
cargo pgx init
no longer assumes a user named "root" exists on the systemMiscellaneous
If you run Postgres or
cargo pgx run
withRUST_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 Ensure thelibpq{,N}-dev
package is removed in CI #1034Fix outdated documentation for
pgx::name!
by @Smittyvb in Fix outdated documentation forpgx::name!
#1036Disable thin lto for dev builds by default in template by @JelteF in Disable thin lto for dev builds by default in template #1035
Respect
RUSTC
/CARGO
environment variables, and handle calls throughcargo
incargo-pgx
andpgx-test
by @thomcc in RespectRUSTC
/CARGO
environment variables, and handle calls throughcargo
incargo-pgx
andpgx-test
#1038Fix some warnings when the time-crate feature is disabled by @thomcc in Fix some warnings active when the time-crate feature is disabled #1054
New Contributors
Thanks everyone!
Full Changelog: v0.7.1...0.7.2