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
- fix
IntoDatum
forCString
andCStr
by @eeeebbbbrrrr in #1063
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)
.
- Don't assume HTTPS_PROXY is HTTPS. by @higuoxing in #1061
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
New Contributors
- @ewencp made their first contribution in #1065
- @higuoxing made their first contribution in #1061
Full Changelog: v0.7.2...v0.7.3