Update Rust crate pgrx to 0.15.0 #7
Open
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 PR contains the following updates:
0.12.6
->0.15.0
Release Notes
pgcentralfoundation/pgrx (pgrx)
v0.15.0
Compare Source
Welcome to pgrx v0.15.0. This begins a new series for pgrx that includes support for Postgres 18. As of this release, that means Postgres 18beta1.
This release does contain a few breaking API changes but they're largely mechanical. Don't worry, the compiler will let you know!
As always, please install our CI tool with
cargo install cargo-pgrx --version 0.15.0 --locked
and then runcargo pgrx upgrade
in all of your extension crates.If you want to start working with Postgres 18beta1, you'll also need to re-init your pgrx environment with
cargo pgrx init
. That will automatically detect all the latest Postgres versions, including 18beta1.At the top here, I'd like to thank @silver-ymz for the 18beta1 support. It was a pleasant surprise to see that work come from the community -- it's no easy task to add a new Postgres version to pgrx!
That said, as Postgres 18 is currently beta, you should consider pgrx' support for it as beta too. Please report any problems with 18beta1 (or discrepancies with other versions) as GitHub issues.
Also, this release requires rust v1.88.0 or greater.
if-let
chains are now a thing and we're not afraid to use them.What's Changed
Postgres 18beta1 Support
#define
by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/2094More Headers
catalog/heap.h
binding by @ccleve in https://github.com/pgcentralfoundation/pgrx/pull/2072utils/pg_status.h
by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/2091cargo-pgrx
improvementsLLVM_*
variables to--runas
command by @theory in https://github.com/pgcentralfoundation/pgrx/pull/2083does_db_exist()
: fixpsql
argument order by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/2093cargo pgrx regress
output is no longer fully buffered by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/2095pgrx_embed
name from lib name by @YohDeadfall in https://github.com/pgcentralfoundation/pgrx/pull/2035cargo-pgrx
: use system certificate store for HTTPS validation by @charmitro in https://github.com/pgcentralfoundation/pgrx/pull/2074Breaking Changes
New Stuff
pg_binary_protocol
attribute to derive send and receive functions forPostgresType
by @LucaCappelletti94 in https://github.com/pgcentralfoundation/pgrx/pull/2068General Code Cleanup
cargo clippy --fix
by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/2092if-let
to unpack Options by @stuhood in https://github.com/pgcentralfoundation/pgrx/pull/2089rust_byte_slice_to_bytea()
docs by @burmecia in https://github.com/pgcentralfoundation/pgrx/pull/2071#[doc(hidden)]
by @LucaCappelletti94 in https://github.com/pgcentralfoundation/pgrx/pull/2079Administrative
New Contributors
Much thanks to our new contributors! Your work is sincerely appreciated!
Full Changelog: pgcentralfoundation/pgrx@v0.14.3...v0.15.0
v0.14.3
Compare Source
Welcome to pgrx v0.14.3.
This point release fixes some issues discovered with the new
cargo pgrx regress
command. Additionally, bindings have been regenerated against the latest Postgres point releases that dropped on May 8th, 2025, though no new headers have been included.As always, please update with
cargo install cargo-pgrx --version 0.14.3 --locked
and update your extensionCargo.toml
files withcargo pgrx upgrade
.What's Changed
cargo pgrx regress
by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/2062<ENTER>
to "Accept[Y, n]?" a test no longer panicsgit add <new expected/test_name.out>
files, we no longer do it to the expected files that we promote in the face of a test failuretest_name.out
file to copy toexpected/
when that's not actually truesetup.sql
test is now treated as a normal test, and the only special handling around is that we'll only run it if we detect we need toPGRX_REGRESS_TESTING=1
so an extension running under the regression test suite can detect itFull Changelog: pgcentralfoundation/pgrx@v0.14.2...v0.14.3
v0.14.2
Compare Source
Welcome to pgrx v0.14.2. This is a minor release that fixes a few bugs and also adds a big new feature: support for
pg_regress
-based regression tests.As always, please update with
cargo install cargo-pgrx --version 0.14.2 --locked
and update your extensionCargo.toml
files withcargo pgrx upgrade
.For the
pg_regress
regression test support, there's a newcargo pgrx regress
subcommand, and it's documented in cargo-pgrx's readme.What's Changed
$libdir/
prefix from module_pathname by @theory in https://github.com/pgcentralfoundation/pgrx/pull/2051This will help with the upcoming Postgres v18 and generally makes pgrx-based extensions less restrictive with regard to how they're installed.
pg_regress
-based tests by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/2058(editor's node: I full expect users to uncover UX nits with this and am more than happy to entertain any ideas that help to improve workflows, either locally during development or in CI. Feel free to open issues about it.)
More Bindings
pg_statistic_ext
catalog by @ArArgon in https://github.com/pgcentralfoundation/pgrx/pull/2053Bug Fixes
tgnargs
inextra_args
by @usamoi in https://github.com/pgcentralfoundation/pgrx/pull/2046Code Cleanup
<Self as ::pgrx::datum::FromDatum>::
by @LucaCappelletti94 in https://github.com/pgcentralfoundation/pgrx/pull/2050New Contributors
Thanks
Shoutout to @philippemnoel of @ParadeDB for paying me to implement the
pg_regress
support. ❤️Full Changelog: pgcentralfoundation/pgrx@v0.14.1...v0.14.2
v0.14.1
Compare Source
This is pgrx v0.14.1. It is a small bugfix release that fixes a problem building extensions that have their own
build.rs
.Please update with
cargo install cargo-pgrx --version 0.14.1 --locked
and update your extensionCargo.toml
files withcargo pgrx upgrade
.What's Changed
cargo pgrx install
error if there is a build script by @usamoi in https://github.com/pgcentralfoundation/pgrx/pull/2041Full Changelog: pgcentralfoundation/pgrx@v0.14.0...v0.14.1
v0.14.0
Compare Source
Welcome to pgrx v0.14.0!
This is our very first release with Windows support. How cool is that? 😎 Much thanks go to all the contributors that have been working on Windows support for so long. There's basic instructions for getting started in the project README.
Beyond that, this release officially removes support for Postgres v12. If you still need to support it, you'll need to lock your dependencies to pgrx v0.13.1.
Additionally, there's a number of bugfixes, more included Postgres headers, and some breaking code changes that'll need attention.
As always, make sure to first install
cargo-pgrx
withcargo install cargo-pgrx --version 0.14.0 --locked
and to update your extensionCargo.toml
files using ourcargo pgrx upgrade
tool.What's Changed
Windows Support
One important note for Windows Support:
This change (using
extern "C-unwind"
) is important to call out separately as it'll require any functions with#[pg_guard]
to be changed to use"C-unwind"
. This came about as a requirement for Windows, but is necessary for all supported platforms.Breaking Changes
pgrx::pg_guard
: functions marked with#[pg_guard]
must use theC-unwind
ABI, andpg_guard
macro generates an error for functions that do not use theC-unwind
ABI.pgrx::lwlock
: the parametername
ofPgLwLock::new
is required;PgLwLock::from_named
is removed; the type of the parametervalue
ofPgLwLock::attach
is changed.pgrx::atomic
: the parametername
ofPgAtomic::new
is required.pgrx::pg_sys
: ABI of all generated binding function types has been changed fromC
toC-unwind
.pgrx-tests
: on Linux, before usingcargo-pgrx
with--runas
, you must relax kernel security restrictions by runningsudo sysctl fs.protected_fifos=0
due to internal implementation details.Bug Fixes
API Changes (likely breaking)
DatumWithOid
: Addnew_from_datum(Option<Datum>, Oid)
andnull_oid(Oid)
by @the-kenny in https://github.com/pgcentralfoundation/pgrx/pull/1999pgstat
macros by @YohDeadfall in https://github.com/pgcentralfoundation/pgrx/pull/2007Display
forOid
by @YohDeadfall in https://github.com/pgcentralfoundation/pgrx/pull/2029xid
by @YohDeadfall in https://github.com/pgcentralfoundation/pgrx/pull/2003This PR actually adds a hand-rolled representation for Postgres'
pg_sys::TransactionId
type. As such, usages ofpg_sys::TransactionId
may need adjustments. If we missed any UX for the type, please file issues (or PRs!) and we'll address them immediately. A benefit of this is that it's now possible to usepg_sys::TransactionId
as arguments or the return type of#[pg_extern]
functions.Oid::as_u32
toto_u32
by @YohDeadfall in https://github.com/pgcentralfoundation/pgrx/pull/2011New Features
PgHeapTuple::set_by_index_unchecked
by @silver-ymz in https://github.com/pgcentralfoundation/pgrx/pull/2012More Headers
storage/buf_internals.h
by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/2008tsearch/ts_cache.h
by @silver-ymz in https://github.com/pgcentralfoundation/pgrx/pull/2010utils/spccache.h
by @usamoi in https://github.com/pgcentralfoundation/pgrx/pull/2023Code Cleanups
IntoDatum
, drop intermediate Vecs fortuples
by @vrmiguel in https://github.com/pgcentralfoundation/pgrx/pull/2017A special thanks to @nyurik for this one. It was a lot of work and should make clippy users a lot happier!
Administrative/CI
rustfmt
to use--edition 2021
by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/2002Thank You!
I just want to send a sincere thank you to all the contributors for this release. It represents a lot of work and I'm sure they hope y'all enjoy it and can make good use of it!
New Contributors
Full Changelog: pgcentralfoundation/pgrx@v0.13.1...v0.14.0
v0.13.1
Compare Source
Welcome to pgrx v0.13.1. This is a minor bugfix and non-breaking feature release.
As always, install the new
cargo-pgrx
CLI tool withcargo install cargo-pgrx --version 0.13.1 --locked
and then runcargo pgrx upgrade
in your extension creates.What's Changed
Bug Fixes
pg_sys::Oid::from_datum()
should cast tou32
by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/1991The underlying bug here would only expose itself with OID values, which are generated by Postgres, larger than an
i32::MAX
. As such, it's taken a few years for someone to run into this in the wild!New Postgres Headers
replication/logicalworker.h
by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/1985Improved SQL Type Handling
Code Cleanup/Future Proofing
unsafe extern
in pgrx_embed.rs by @usamoi in https://github.com/pgcentralfoundation/pgrx/pull/1990New
cargo-pgrx run
Option--install-only
option for cargo pgrx run command by @SergeiPatiakin in https://github.com/pgcentralfoundation/pgrx/pull/1988Running
cargo pgrx run --install-only
will do exactly that -- only install the extension in the pgrx-managed Postgres instance. Note that it will also stop the Postgres instance if it's running, but it will not restart it.New Contributors
Thanks to our new contributors! It's nice to see people scratching their own itches!!
Full Changelog: pgcentralfoundation/pgrx@v0.13.0...v0.13.1
v0.13.0
Compare Source
Welcome to pgrx v0.13.0. The first update in a little bit, which makes pgrx current with upstream dependencies, rust 1.85.0 (but not 2024 Edition, yet), and a slew of fixes and cleanups and community contributions.
Upgrading
You'll need to
cargo install cargo-pgrx --version 0.13.0 --locked
to get the latestcargo-pgrx
tool, and then you can runcargo pgrx upgrade
in your extension crates to update their dependencies.Breaking Changes
Generally, the only breaking changes in v0.13.0 are related to the user-facing SPI APIs. In general, SPI functions that previously took a Vec of Arguments now take a
&[DatumWithOid]
, with proper lifetime bounds. This is a fairly straightforward boilerplate to update.@YohDeadfall has done a lot of work on improving SPI's safety and it's greatly appreciated!
What's Changed
cargo-pgrx
cargo pgrx install
duringget_git_hash()
by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/1935cargo pgrx test --runas
envar passing by @eeeebbbbrrrr in https://github.com/pgcentralfoundation/pgrx/pull/1674Build System
allowlist_file
for bindgen by @usamoi in https://github.com/pgcentralfoundation/pgrx/pull/1922pg_config --libdir
to linker search path by @usamoi in https://github.com/pgcentralfoundation/pgrx/pull/1932SPI
General
pgrx-pg-sys
Interfacesoids_of!
macro by @YohDeadfall in https://github.com/pgcentralfoundation/pgrx/pull/1879bufpage.h
functions by @rebasedming in https://github.com/pgcentralfoundation/pgrx/pull/1982Bug Fixes
wait_latch
function to exit onWL_POSTMASTER_DEATH
by @var77 in https://github.com/pgcentralfoundation/pgrx/pull/1938Overall Code Cleanup
&
) by @hamirmahal in https://github.com/pgcentralfoundation/pgrx/pull/1941Thanks!
Thanks to the community, past, present, and future. Especially to our new contributors...
New Contributors
Full Changelog: pgcentralfoundation/pgrx@v0.12.7...v0.13.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.