github pgcentralfoundation/pgrx v0.7.3

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

Welcome to pgx v0.7.3. It has a few minor bugfixes and API additions, along with an API-breaking change related to GUCs.

When upgrading please install cargo-pgx with cargo install cargo-pgx --locked.

What's New

New functions (pgx::spi::{quote_identifier, quote_qualified_identifier, quote_literal}) have been added to quote SQL identifiers and literals. These all delegate back into Postgres, so Postgres' quoting rules apply.

This adds a new pgx::gucs::GucFlags struct along with a new flags: GucFlags argument to the various GucRegistry::define_xxx_guc() functions. This is a user-facing API change, but it allows, among other things, for a GUC to indicate that maybe its unit is a byte or seconds. Specifying GucFlags::default() as this argument will quickly migrate your code while maintaining backwards compatibility.

Now, when running a cargo pgx init where pgx compiles Postgres, it'll include all the contrib/ packages as well. This will let you also use extensions like hstore or citext in the databases managed by cargo-pgx.

If you'd like to do this now, just run cargo pgx init again. Your existing databases will be preserved.

Bug Fixes

The IntoDatum implementation for these types made an awful assumption that the backing pointer was already palloc'd by Postgres. This is not what CString and CStr mean, and this assumption could have led to UAF. They've been re-implemented to copy the backing pointer to a palloc'd memory.

If you are wanting to convert a raw, palloc'd pointer into a Datum, just use Datum::from(ptr).

The cargo-pgx CLI tool can use a proxy when it makes network requests. This generalizes the proxy url parsing such that "https" is not hardcoded and is instead intuited from the proxy string itself.

Other Changes

  • Bump tempfile dep to 3.4.0, and several other deps. by @thomcc in #1059

New Contributors

Full Changelog: v0.7.2...v0.7.3

Don't miss a new pgrx release

NewReleases is sending notifications on new releases.