Skip to content

v0.6.0-alpha.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@workingjubilee workingjubilee released this 12 Nov 00:16
· 322 commits to master since this release
7431028

Welcome to the first prerelease of pgx 0.6.0!
Remember to use cargo install cargo-pgx --version 0.6.0-alpha.0 --locked!

Postgres Major Support

This release introduces support for Postgres 15 and drops support for Postgres 10, thanks to @Smittyvb, @BradyBonnette, @yrashk, and @steve-chavez.

Numeric

Thanks to @eeeebbbbrrrr, proper support for SQL's NUMERIC has landed in PGX, using two types:

  • AnyNumeric
  • Numeric<const P: u32, const S: u32>

Obviously, this breaks code using Numeric as it currently is, which is more like AnyNumeric.

Usage Note: As far as we are able to discern, AnyNumeric is the type used by Postgres on SQL function entry and exit, even if you specify a precision and scale in SQL, so for the case of #[pg_extern] you should probably prefer AnyNumeric, and deliberately convert to Numeric<P, S> inside functions if needed. Numeric<P,S> helps most with serialization, writing to tables, and other cases Postgres also uses strict precision and scale.

Error Handling has been revamped

Error handling has been revamped in a way that may be breaking if you were directly handling PGX's error-handling functions, which are intended to be used when you extend this with your own error-handling abstractions. This includes a lot more support for the kinds of patterns allowed by PG_TRY and PG_CATCH. Take a look at PgTryBuilder.

cargo pgx can use rustls!

You can now configure cargo-pgx to use rustls instead of native SSL, but you must intentionally build it that way for now.

Data can now actually return!

@yrashk expanded the ability of various contexts to allow data to escape them: background workers can return values from transaction, and Spi::connect can now return values without the FromDatum + IntoDatum bound.

Performance with soundness?

pgx-pg-sys build improvements

Pertinent to our Postgres version support updates, @BradyBonnette taught pgx-pg-sys how to warn if you use an unsupported version of Postgres. @thomcc also removed our need for rayon to build. We also gained some bindings:

  • Include extension & namespace catalogs by @yrashk in #836
  • Add bindings for typedefs within replication/logical.h to pg_sys by @agamble in #827

Miscellaneous Improvements

Most other changes are more subtle quality of life improvements:

New Contributors

Full Changelog: v0.5.6...v0.6.0-alpha.0