Releases: pgcentralfoundation/pgrx
v0.16.0
Welcome to pgrx v0.16.0.
This release contains support for Postgres 18beta2 and has some breaking changes in that support for pgrx' "hooks" implementation, which has been deprecated for over a year, has finally been removed.
Additionally, due to unsoundness issues, direct support for using heapless
in shared memory has been removed. Users can still do this themselves, which requires them to assert they're taking responsibility of possible unsoundness issues.
As always, first install the latest cargo-pgrx
with:
$ cargo install cargo-pgrx --version 0.16.0 --locked
Then you're free to run cargo pgrx upgrade
in the root of all your extension crates.
To pickup pg18beta2 support you'll also want to run cargo pgrx init
so that it can be downloaded and compiled.
What's Changed
Breaking Changes
New Features
- update to Postgres v18beta2 by @usamoi in #2111
- feat:
BackgroundWorker::connect_worker_to_spi_by_oid
by @if0ne in #2116 - teach
#[pg_cast]
to support 3-argument CAST functions by @eeeebbbbrrrr in #2119 - teach
#[pg_extern]
about a SUPPORT function by @eeeebbbbrrrr in #2121
Bug Fixes
- fix name_data_to_str by @usamoi in #2108
- add pg_guard_ffi_boundary to direct_pg_extern_function_call_as_datum by @usamoi in #2118
cargo-pgrx
Improvements
- add
--valgrind
to more cargo-pgrx subcommands by @usamoi in #2109 cargo pgrx regress --resetdb
will runsetup.sql
by @ccleve in #2113
Code Cleanup
- filter out unrecognized attributes in PostgresGucEnum by @usamoi in #2102
- Elide needless lifetime by @nyurik in #2097
Package/Build System Cleanup
- chore: include pgrx-version-updater into workspace by @nyurik in #2101
- chore: consolidate package settings in workspace by @nyurik in #2100
- chore: prepare for 2024 edition by @nyurik in #2103
Thanks!
Thanks to all contributors -- y'alls work helps keep pgrx moving forward.
Full Changelog: v0.15.0...v0.16.0
v0.15.0
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 run cargo 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
- Support Postgres 18beta1 by @silver-ymz in #2056
- pg18 support: add header and implement
#define
by @eeeebbbbrrrr in #2094 - improve pg_magic_func by @usamoi in #2088
More Headers
- Added
catalog/heap.h
binding by @ccleve in #2072 - include
utils/pg_status.h
by @eeeebbbbrrrr in #2091
cargo-pgrx
improvements
- Pass
LLVM_*
variables to--runas
command by @theory in #2083 does_db_exist()
: fixpsql
argument order by @eeeebbbbrrrr in #2093cargo pgrx regress
output is no longer fully buffered by @eeeebbbbrrrr in #2095- Detect
pgrx_embed
name from lib name by @YohDeadfall in #2035 - Fixed error message if no artifact found by @YohDeadfall in #2034
cargo-pgrx
: use system certificate store for HTTPS validation by @charmitro in #2074- Decoding command output in Windows by @if0ne in #2084
Breaking Changes
New Stuff
- Added
pg_binary_protocol
attribute to derive send and receive functions forPostgresType
by @LucaCappelletti94 in #2068 - Expose guc hooks by @thesuhas in #2075
- Allows to create multiple aggregates for the same Rust type by @if0ne in #2078
General Code Cleanup
cargo clippy --fix
by @eeeebbbbrrrr in #2092- Use
if-let
to unpack Options by @stuhood in #2089 - docs: fix typo in
rust_byte_slice_to_bytea()
docs by @burmecia in #2071 - Added a missing
#[doc(hidden)]
by @LucaCappelletti94 in #2079
Administrative
- Updated Fedora to latest in CI by @YohDeadfall in #2085
- fix ci on beta rust (1.89) by @usamoi in #2087
New Contributors
Much thanks to our new contributors! Your work is sincerely appreciated!
- @charmitro made their first contribution in #2074
- @thesuhas made their first contribution in #2075
- @if0ne made their first contribution in #2084
- @stuhood made their first contribution in #2089
Full Changelog: v0.14.3...v0.15.0
v0.14.3: Update version to 0.14.3 (#2063)
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 extension Cargo.toml
files with cargo pgrx upgrade
.
What's Changed
- Fixes to
cargo pgrx regress
by @eeeebbbbrrrr in #2062- Pressing
<ENTER>
to "Accept[Y, n]?" a test no longer panics - While we still
git 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 failure - Fix a bug where we'd think there's a
test_name.out
file to copy toexpected/
when that's not actually true - The
setup.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 to - Cleanup test run output to be consistent between Postgres versions
- Set
PGRX_REGRESS_TESTING=1
so an extension running under the regression test suite can detect it
- Pressing
Full Changelog: v0.14.2...v0.14.3
v0.14.2
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 extension Cargo.toml
files with cargo pgrx upgrade
.
For the pg_regress
regression test support, there's a new cargo pgrx regress
subcommand, and it's documented in cargo-pgrx's readme.
What's Changed
This will help with the upcoming Postgres v18 and generally makes pgrx-based extensions less restrictive with regard to how they're installed.
- initial support for
pg_regress
-based tests by @eeeebbbbrrrr in #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
Bug Fixes
Code Cleanup
- Added absolute path to call
<Self as ::pgrx::datum::FromDatum>::
by @LucaCappelletti94 in #2050 - Removed duplicate ok check by @YohDeadfall in #2044
New Contributors
- @LucaCappelletti94 made their first contribution in #2050
- @ArArgon made their first contribution in #2053
Thanks
Shoutout to @philippemnoel of @paradedb for paying me to implement the pg_regress
support. β€οΈ
Full Changelog: v0.14.1...v0.14.2
v0.14.1
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 extension Cargo.toml
files with cargo pgrx upgrade
.
What's Changed
Full Changelog: v0.14.0...v0.14.1
v0.14.0
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
with cargo install cargo-pgrx --version 0.14.0 --locked
and to update your extension Cargo.toml
files using our cargo pgrx upgrade
tool.
What's Changed
Windows Support
One important note for Windows Support:
If an extension is compiled for Windows, the pgrx
cshim
feature must be enabled. If an extension does not enable thecshim
feature in itsCargo.toml
,cargo build --features pgrx/cshim
can be used at build time.
- fix cargo-pgrx and pgrx-tests on Windows by @usamoi in #1934
- tell C compiler to put code and data in separate sections by @usamoi in #2006
- force using extern "C-unwind" for functions marked with #[pg_guard] by @usamoi in #2014
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
- fix: invalid error info in PgHeapTuple::set_by_index by @silver-ymz in #1998
- Fixed expected message for retinfo check by @YohDeadfall in #2031
API Changes (likely breaking)
DatumWithOid
: Addnew_from_datum(Option<Datum>, Oid)
andnull_oid(Oid)
by @the-kenny in #1999- Implemented
pgstat
macros by @YohDeadfall in #2007 - Implemented
Display
forOid
by @YohDeadfall in #2029 - Added mapping for
xid
by @YohDeadfall in #2003
This PR actually adds a hand-rolled representation for Postgres' pg_sys::TransactionId
type. As such, usages of pg_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 use pg_sys::TransactionId
as arguments or the return type of #[pg_extern]
functions.
- Renamed
Oid::as_u32
toto_u32
by @YohDeadfall in #2011
New Features
- Enable cross compiling extensions by @rhelmot in #1994
- feat: add
PgHeapTuple::set_by_index_unchecked
by @silver-ymz in #2012
More Headers
- include
storage/buf_internals.h
by @eeeebbbbrrrr in #2008 - include
tsearch/ts_cache.h
by @silver-ymz in #2010 - include
utils/spccache.h
by @usamoi in #2023 - add partitioning headers by @eeeebbbbrrrr in #2018
Code Cleanups
- Dedup array
IntoDatum
, drop intermediate Vecs fortuples
by @vrmiguel in #2017 - A number of small lints by @nyurik in #2026
A special thanks to @nyurik for this one. It was a lot of work and should make clippy users a lot happier!
Administrative/CI
- Removed support of PostgreSQL 12 by @YohDeadfall in #2028 and #2036
- Fix typo on README.md by @lizardoluis in #1995
- Pinned cargo-edit version by @YohDeadfall in #2004
- Updated cargo-edit by @YohDeadfall in #2005
- Updated Alpine version to 3.21 by @YohDeadfall in #2015
- Instruct
rustfmt
to use--edition 2021
by @eeeebbbbrrrr in #2002 - Fixed typo in gcd docs by @YohDeadfall in #2027
- Fixed docker file for alpine by @YohDeadfall in #2024
- update readme about Windows requirements by @usamoi in #2019
- Search artifacts by manifest path by @YohDeadfall in #2032
- Fixed Discord invitation link by @YohDeadfall in #2033
- cargo-fmt by @eeeebbbbrrrr in #2038
- update dependencies and fix compilation problem on pg13 by @eeeebbbbrrrr in #2039
Thank 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
- @lizardoluis made their first contribution in #1995
- @rhelmot made their first contribution in #1994
Full Changelog: v0.13.1...v0.14.0
v0.13.1
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 with cargo install cargo-pgrx --version 0.13.1 --locked
and then run cargo pgrx upgrade
in your extension creates.
What's Changed
Bug Fixes
pg_sys::Oid::from_datum()
should cast tou32
by @eeeebbbbrrrr in #1991
The 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
- add
replication/logicalworker.h
by @eeeebbbbrrrr in #1985
Improved SQL Type Handling
- Implement SqlTranslatable for TableAmRoutine by @dpxcc in #1989
- feat: auto-generate type alignment (#[pgrx(alignment = "on")]) by @JamesGuthrie in #1942
Code Cleanup/Future Proofing
- Minor prettifications in SPI docs by @YohDeadfall in #1987
- use
unsafe extern
in pgrx_embed.rs by @usamoi in #1990
New cargo-pgrx run
Option
--install-only
option for cargo pgrx run command by @SergeiPatiakin in #1988
Running 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!!
- @SergeiPatiakin made their first contribution in #1988
- @dpxcc made their first contribution in #1989
Full Changelog: v0.13.0...v0.13.1
v0.13.0
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 latest cargo-pgrx
tool, and then you can run cargo 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
- fix a deadlock in
cargo pgrx install
duringget_git_hash()
by @eeeebbbbrrrr in #1935 cargo pgrx test --runas
envar passing by @eeeebbbbrrrr in #1674- Search for sql upgrade scripts relative to the package manifest by @tristan957 in #1979
Build System
- use
allowlist_file
for bindgen by @usamoi in #1922 - add
pg_config --libdir
to linker search path by @usamoi in #1932 - lock patch version of pgrx-bindgen by @usamoi in #1939
- Introduce a blocklist of "yanked" Postgres versions by @eeeebbbbrrrr in #1950
- Make sure bindgen gets the cppflags even if we aren't using macOS by @thomcc in #1336
SPI
- Made SPI query arguments type safe by @YohDeadfall in #1858
- Changed args of prepare methods to be slices by @YohDeadfall in #1933
- Added connect_mut for data changing SPI operations by @YohDeadfall in #1913
General pgrx-pg-sys
Interfaces
- Allow creating Oid from a u32 in a const context by @syvb in #1943
- Add utils/acl.h by @daamien in #1945
- Add catalog/catalog.h by @daamien in #1946
- Added
oids_of!
macro by @YohDeadfall in #1879 - Port
bufpage.h
functions by @rebasedming in #1982
Bug Fixes
Overall Code Cleanup
- refactor: remove redundant references (
&
) by @hamirmahal in #1941 - fix warnings by @usamoi in #1948
- Updating readme.md by @ChronicallyJD in #1949
- style: simplify some statements for readability by @hamirmahal in #1962
- docs: fix pgx info in cargo-pgrx README by @mrdrivingduck in #1953
- Updated expected UI test outputs by @YohDeadfall in #1981
- Fix "about" info for cross subcommand by @mjgarton in #1974
- update dependencies and fix compilation issues by @eeeebbbbrrrr in #1983
Thanks!
Thanks to the community, past, present, and future. Especially to our new contributors...
New Contributors
- @var77 made their first contribution in #1938
- @ChronicallyJD made their first contribution in #1949
- @mrdrivingduck made their first contribution in #1953
- @tristan957 made their first contribution in #1979
- @mjgarton made their first contribution in #1974
Full Changelog: v0.12.7...v0.13.0
v0.12.9
This is pgrx v0.12.9. This version will refuse to build against Postgres versions 17.1, 16.5, 15.9, 14.14, 13.17, and 12.21. These Postgres versions introduced an ABI incompatibility that we'd rather just not ever have to deal with.
As always, to upgrade please run cargo install cargo-pgrx --version v0.12.9 --locked
.
You may need to run another cargo pgrx init
to pickup the new latest versions of each major release.
What's Changed
- Blocklist "bad" postgres versions by @eeeebbbbrrrr in #1950
- Update version to 0.12.9 by @eeeebbbbrrrr in #1951
Full Changelog: v0.12.8...v0.12.9
v0.12.8
This is pgrx v0.12.8. It fixes a potential deadlock during the cargo-pgrx
"install" process if any of the extension schema files include the @GIT_HASH@
variable. How bizarre!
As always, to upgrade please run cargo install cargo-pgrx --version v0.12.8 --locked
.
What's Changed
- PR #1935