Releases: pgcentralfoundation/pgrx
v0.11.1
Hello. Welcome to pgrx v0.11.1, a bugfix release that hopefully addresses a very annoying persistent problem for users, especially ones that were trying to use pgrx with Postgres 16! My (@workingjubilee)'s changes in b992f55 now steer bindgen towards including the exact compiler-header directory that we require, instead of relying on clang-sys to guess the right directory in ways that can go horribly wrong. Unfortunately, this may make our build step more brittle in certain cases. Please report issues as they arise, so that we can continue to refine our build system, and eventually fix this in bindgen proper!
This new behavior can still be disabled by setting PGRX_BINDGEN_NO_DETECT_INCLUDES
, as it is still a form of autodetecting includes, but if this release fixes your build that was previously relying on that or any other easily-removed hack, please let us know!
Also, thanks to @LuminousMonkey, you can now use pgrx on illumos, an operating system descended from Solaris, with no changes to your source code!
Full Changelog: v0.11.0...v0.11.1
v0.11.0
Welcome to pgrx v0.11.0. It's a new "major" release with some new features, a faster "build.rs", and some bugfixes.
As always, please update by running cargo install cargo-pgrx --version 0.11.0 --locked
and update your extension crate Cargo.toml
files accordingly.
What's Changed
Faster Buildings
@workingjubilee did some work to improve build times. As measured on their computer against cargo check
, it's roughly a quarter faster. In doing so, the generated "bindings.rs" files look a little different and our "build.rs" has been cleaned up a bit.
- Make check builds ~25% faster by merging extern blocks by @workingjubilee in #1316
- Touch up Display for PgNode by @workingjubilee in #1313
- Consistently order generated impls by @workingjubilee in #1314
- Organize bindgen arg sets in fn (nfc) by @workingjubilee in #1312
- Check for
is_for_release
once by @workingjubilee in #1315 - Report build versions that conflict by @workingjubilee in #1310
Pure Rust implementation for PgList
@workingjubilee did a tremendous amount of work creating a proper wrapper around Postgres' internal List
type, called PgList
.
- Introduce pure-Rust replacement for PgList by @workingjubilee in #1277
- Remove incorrect List::drain assert by @workingjubilee in #1283
- when constructing a new ListCell, the 'next' node begins life as NULL by @eeeebbbbrrrr in #1285
- Fix some List sizing bugs by @workingjubilee in #1289
- Actually use repalloc return in List by @workingjubilee in #1291
- Rename node_list.rs -> linked_list.rs by @workingjubilee in #1286
Some background here is that we intend to add the "dynamic function call" work (see below) to PL/Rust. In doing that work, use of Postgres' List
type is pretty important and pgrx' existing implementation was a) mostly in the cshim, and b) just not very-good-and-sound. Considering (b) and also that PL/Rust isn't able to use anything from pgrx' chsim (a), @workingjubilee set out to make a proper Rust wrapper/implementation of Postgres' List
type.
Note: As part of this, NodeTag
is now a proper enum
, which requires a small migration which is mostly satisfied by a regex-based find-replace of NodeTag_T_[A-Za-z]*
with NodeTag::T_$1
.
More Bindings
We've added more Postgres internals headers to the pgrx-pg-sys
crate:
- Generate bindings for WAL recovery functions by @feikesteenbergen in #1294
- Include bindings for controlfile by @feikesteenbergen in #1320
- Bind catalog header definitions for access method tables by @workingjubilee in #1306
Dynamic Function Calling
pgrx now allows calling any SQL-defined function (ie, via CREATE FUNCTION
) in a (mostly) Rusty way with the new dynamic function calling support. Some documentation around this feature can be found in the sources, here and in the unit tests.
- Dynamic function call by @eeeebbbbrrrr in #1279
As mentioned above, this feature will be exposed in PL/Rust soon. However, it's still an extremely powerful feature for pure pgrx extensions as it allows calling another function directly, with runtime type safety checks, without incurring any Spi overhead.
cargo pgrx install --sudo
Sometimes cargo-pgrx install
can be tough to work with if targeting a package manager-managed Postgres installation as the various extension directories are owned by root. cargo pgrx install --sudo
fixes that by copying the files as root. The build, which is typically done as a regular user, is still run by that user -- only the file copying is run with sudo
.
- Add
cargo pgrx install --sudo
by @eeeebbbbrrrr in #1322
Miscellaneous Work
- Replace cshimmed fn by @workingjubilee in #1304
- Enable proptest in more workflows by @workingjubilee in #1309
- Float Dockerfile's Fedora version by @workingjubilee in #1311
- Fix pg16 CI by @eeeebbbbrrrr in #1326
Thanks!
Thanks to all the contributors! We appreciate the PRs and testing. And we especially like hearing about what you're building with pgrx.
Full Changelog: v0.10.2...v0.11.0
v0.10.2
Welcome to pgrx v0.10.2!
In pgrx v0.10.0, as part of a refactoring step in order to make refactoring easier in the future, without things like losing track of random functions, we... omitted a few functions! These depended on the cshim, but were not direct bindings, themselves. Oops. They're back now in pgrx::pg_sys
.
cargo pgrx
works now for Postgres 16 on macOS
Installing extensions on macOS for Postgres 16 had problems due to recent changes to Postgres defaults. We have fixed this and expanded our test coverage for macOS to reduce the odds of this happening in the future, thanks to @bayandin in #1300
composites compose better
There were some problems with composite types and arrays, and specifically arrays of composite types in composite types. These are the sorts of things that cause edge cases in PgHeapTuple. They should now be appropriately supported, however, thanks to @eeeebbbbrrrr in #1303
#[pg_schema]
will enable your bad ideas
The following should now work appropriately:
#[pgrx::pg_schema]
mod pg_catalog {
It does what you think it does. Since this can affect a global namespace in a way that makes it much easier to conflict with other extensions, it is best to avoid this. However, it is the sort of bad idea that extensions which "take over" the Postgres host to extensively redefine the host's capabilities, like ZomboDB does, may have to resort to in order to accomplish their goal. Thanks to @eeeebbbbrrrr in #1302
Keep the bug reports coming
And thank you for reporting your issues!
v0.10.1
This is pgrx v0.10.1. It includes support for Postgres v16 and since pg16 is now released, cargo pgrx init
will now be able to download the latest version.
As always, please install the latest cargo-pgrx with cargo install cargo-pgrx --version 0.10.1 --locked
and update your Cargo.toml dependencies.
What's Changed
#1295: Support the official Postgres v16 release
#1294: Add WAL recovery header bindings for pg15 and pg16
Full Changelog: v0.10.0...v0.10.1
v0.10.0
This is the final release of v0.10.0. Thanks everyone for the beta testing, pull requests, issues, and patience.
As always, install cargo-pgrx
with cargo install cargo-pgrx --locked
and update your extension Cargo.toml files to use the 0.10.0
pgrx dependencies.
This release includes support for Postgres 16RC1. Support for the previous betas has been removed. As such, a fresh cargo pgrx init
is required.
What's Changed Since v0.10.0-beta.4
- Fix
GetMemoryChunkContext
port by @workingjubilee in #1273 - Better error messages when
pg_config
isn't found. by @eeeebbbbrrrr in #1271 - Make
PostgresHash
also needEq
by @workingjubilee in #1264 - Memoize git hash and extension metadata by @levkk in #1274
- move to pg16rc1 by @eeeebbbbrrrr in #1276
- Fix bgworker template up to 0.10.0-beta.4 by @workingjubilee in #1270
New Contributors
Changelog: v0.10.0-beta.4...v0.10.0
v0.10.0's full set of changes throughout the entire beta period are:
- Postgres 16beta1 Support by @eeeebbbbrrrr in #1169
- Support building against macOS universal binaries by @clowder in #1166
- list specific versions in feature gates by @eeeebbbbrrrr in #1175
- Fix bug with converting a
pg_sys::Datum
into apgrx::Date
by @eeeebbbbrrrr in #1177 - Fix Arrays with leading nulls by @eeeebbbbrrrr in #1180
- Disable hello_versioned_so test by @workingjubilee in #1192
- doc: fix link broken by @yihong0618 in #1181
- fcinfo: fix incorrect length set in unsafe code by @Sasasu in #1190
- update to pg16beta2 support by @eeeebbbbrrrr in #1188
- Array-walking is aligned by @workingjubilee in #1191
- Implement PGRXSharedMemory for Deque by @feikesteenbergen in #1170
- Include security labels header by @daamien in #1189
- Fixes macos-11 tests by @BradyBonnette in #1197
- Pgcentralfoundation updates again by @eeeebbbbrrrr in #1200
- Update version to 0.10.0-beta.0 by @eeeebbbbrrrr in #1201
- Testing help by @eeeebbbbrrrr in #1203
- Type testability cleanup by @eeeebbbbrrrr in #1204
- Try to smartly propagate fs errors by @workingjubilee in #1186
- Fix issue #1209 by @eeeebbbbrrrr in #1210
- Type roundtrip tests by @eeeebbbbrrrr in #1185
- Update version to 0.10.0-beta.1 by @eeeebbbbrrrr in #1213
- Add a workaround for the pg16/homebrew/icu4c situation by @thomcc in #1206
- Add security policy by @johnrballard in #1207
AnyNumeric
is no longer backed by Postgres-allocated memory by @eeeebbbbrrrr in #1216- Modularize pgrx::spi by @workingjubilee in #1219
- Stop SpiClient soundness from regressing by @workingjubilee in #1214
- Add foreign table headers by @workingjubilee in #1226
- Modularize the interior of pgrx-pg-sys by @workingjubilee in #1227
- Initial valgrind support by @thomcc in #1218
- Add support for handling SIGINT and SIGCHLD from bgworker by @JelteF in #1229
- Ignores UI tests for MUSL environments by @BradyBonnette in #1235
- Add a env flag that can be set to skip
#[pg_test]
-generated tests. by @thomcc in #1239 - Fix issue #1076: Properly handle dependency graph of
Result<T, _>
by @eeeebbbbrrrr in #1241 - Cleanup the error when cargo-pgrx version doesn't match Cargo.toml by @eeeebbbbrrrr in #1240
- Add operator and cache related api by @VoVAllen in #1242
- Addresses cargo-pgrx error reporting by @BradyBonnette in #1238
- Update version to 0.10.0-beta.2 by @eeeebbbbrrrr in #1244
- Bump cargo-metadata and clap-cargo by @thomcc in #1246
- Derive Clone for Inet by @JelteF in #1251
- Correct docs for datetime
From
impls by @workingjubilee in #1253 - Only enable line tables for profile.dev by @thomcc in #1249
- Remove references to master branch by @thomcc in #1243
- Ensure bindgen gets all the
cppflags
it needs (on macOS, anyway) by @thomcc in #1247 - update for pg16beta3 support by @eeeebbbbrrrr in #1254
- Update version to 0.10.0-beta.3 by @eeeebbbbrrrr in #1255
- Add proptest support by @workingjubilee in #1258
- Misc reformatting and typo fixes by @workingjubilee in #1260
- spi: simplify (optimize?) Datum preparation by @vrmiguel in #1256
- Assume commutation when deriving PostgresEq by @workingjubilee in #1261
- Demand Ord for PostgresOrd by @workingjubilee in #1262
- Fix pgrx install causing postgresql coredump by @Sasasu in #1263
- Update version to 0.10.0-beta.4 by @workingjubilee in #1267
New Contributors
- @clowder made their first contribution in #1166
- @yihong0618 made their first contribution in #1181
- @Sasasu made their first contribution in #1190
- @daamien made their first contribution in #1189
- @johnrballard made their first contribution in #1207
- @VoVAllen made their first contribution in #1242
- @vrmiguel made their first contribution in #1256
Full Changelog: v0.9.8...v0.10.0
v0.10.0-beta.4
The fifth beta release of 0.10.0!
#[pg_test]
-compatible proptest support in #1258 courtesy of moi- PostgresEq (#1261) and PostgresOrd (#1262) now explicitly require their "base" Rust traits, which may hypothetically break some impls, but in exchange your equality implementations are now presumed to be commutative.
- Work on improving/simplifying/optimizing our SPI continues, with @vrmiguel contributing some polish to Datum preparation in #1256
- We have been finding some extra-spicy edge cases in how PGRX interacts with a continuously-operational Postgres installation which might feature extensions being installed and reinstalled lately! @Sasasu fixed at least one core-dump-causing case from
cargo pgrx install
in #1263
New Contributors
Full Changelog: v0.10.0-beta.3...v0.10.0-beta.4
v0.10.0-beta.3
This is pgrx v0.10.0-beta.3. The 4th beta in our series that includes Postgres 16 support. In this release, Postgres 16 support has been updated to pg16beta3.
To work with this beta please install cargo-pgrx
with cargo install cargo-pgrx --version 0.10.0-beta.3 --locked
and update the pgrx dependency versions in any extension crates. Then make sure to add a "pg16" feature flag.
What's Changed
- update for pg16beta3 support by @eeeebbbbrrrr in #1254
Usability
- Derive Clone for Inet by @JelteF in #1251
- Ensure bindgen gets all the
cppflags
it needs (on macOS, anyway) by @thomcc in #1247
Documentation
- Correct docs for datetime
From
impls by @workingjubilee in #1253
Internal
- Only enable line tables for profile.dev by @thomcc in #1249
- Bump cargo-metadata and clap-cargo by @thomcc in #1246
- Remove references to master branch by @thomcc in #1243
Full Changelog: v0.10.0-beta.2...v0.10.0-beta.3
v0.10.0-beta.2
This is the third beta in the pgrx v0.10.x series. It contains a number of soundness fixes, better error handling, more testing, and other general code cleanup.
Soundness Issues
AnyNumeric
is no longer backed by Postgres-allocated memory by @eeeebbbbrrrr in #1216
CI and general Testing Support
- Testing help by @eeeebbbbrrrr in #1203
- Type testability cleanup by @eeeebbbbrrrr in #1204
- Type roundtrip tests by @eeeebbbbrrrr in #1185
- Stop SpiClient soundness from regressing by @workingjubilee in #1214
- Initial valgrind support by @thomcc in #1218
- Add a env flag that can be set to skip
#[pg_test]
-generated tests. by @thomcc in #1239 - Ignores UI tests for MUSL environments by @BradyBonnette in #1235
- Changes GHA workflows to use new upgraded runners by @BradyBonnette in #1225
General Improvements
- Add support for handling SIGINT and SIGCHLD from bgworker by @JelteF in #1229
- Fix issue #1076: Properly handle dependency graph of
Result<T, _>
by @eeeebbbbrrrr in #1241
Improved Error Reporting
- Try to smartly propagate fs errors by @workingjubilee in #1186
- Addresses cargo-pgrx error reporting by @BradyBonnette in #1238
- Cleanup the error when cargo-pgrx version doesn't match Cargo.toml by @eeeebbbbrrrr in #1240
Additional Postgres Headers
- Add operator and cache related api by @VoVAllen in #1242
- Add foreign table headers by @workingjubilee in #1226
- Add postmaster related api by @JelteF in #1237
Internal Code Organization
- Modularize pgrx::spi by @workingjubilee in #1219
- Modularize the interior of pgrx-pg-sys by @workingjubilee in #1227
Postgres 16-motivated Changes
General Project Stuff
- Add security policy by @johnrballard in #1207
New Contributors
- @johnrballard made their first contribution in #1207
- @VoVAllen made their first contribution in #1242
Full Changelog: v0.10.0-beta.1...v0.10.0-beta.2
v0.10.0-beta.1
Welcome to pgrx v0.10.0-beta.1. The second in our series to add Postgres 16 support.
This release contains a few bugfixes around arrays of certain types and compile-time Spi API soundness. It also improves the output of cargo pgrx test
test failures.
To evaluate this release please run cargo install cargo-pgrx --version 0.10.0-beta.1 --locked && cargo pgrx init
. And make sure to update your extension crate dependencies as well, adding a corresponding pg16
line to the [features]
block.
What's Changed
- Testing help by @eeeebbbbrrrr in #1203
- Type testability cleanup by @eeeebbbbrrrr in #1204
- Try to smartly propagate fs errors by @workingjubilee in #1186
- Type roundtrip tests by @eeeebbbbrrrr in #1185
- Spi API Lifetime Correctness by @eeeebbbbrrrr in #1210
Full Changelog: v0.10.0-beta.0...v0.10.0-beta.1
v0.9.8
This is pgrx v0.9.8. It is a minor release that fixes some soundness problems with Spi, improves cargo pgrx test
test failure output, fixes a soundness bug with arrays of pg_sys::Point
and pg_sys::BOX
, and introduces some additional testing.
As usual, please install with cargo install cargo-pgrx --locked
and update your extension crate dependencies accordingly.
While we're moving forward with the v0.10.0 line that includes Postgres 16 beta support we've fixed some other important bugs along the way and felt it prudent to add to the 0.9.x releases.
What's Changed
-
PRs #1204, and #1185 - These improve general "roundtrip" testing for all pgrx-supported datatypes and in doing so uncovered and then fixed (in #1185) a bug with
Array<pg_sys::Point>
andArray<pg_sys::BOX>
. -
PR #1209 fixes lifetime issues with the safe Spi API. Previously, it was possible for
SpiTupleTable
andPreparedStatement
objects to escape theSpi::connect(|c| ...)
scope, causing those objects to have been freed by Postgres but still assumed valid by Rust. If you had any Spi-related code that did this, it will no longer compile. This was the intent for the Spi API wrapper from the beginning, but escaped our usability testing. -
PR #1190 is from first-time contribution from @Sasasu. It fixes an over-read of the "FcInfo" function arguments array for Postgres versions 12-15. In practice pgrx would never had read more than the actual array, but technically it could have without a bounds check.
-
PR #1191 - This asserts that array-walking is properly aligned and removes an erroneous assert causing construction of certain types of arrays to raise an ERROR.
-
PR #1203 improves the
cargo pgrx test
output for individual tests that fail. In all cases now it'll output generic postgres log messages, postgres log messages generated by the failing test, and the error message received by the client. This should help to improve general debugging. -
PR #1183 cleans up generic filesystem error handling. This is mostly specific to the
cargo-pgrx
binary but does touchpgrx-pg-sys/build.rs
too.
Full Changelog: v0.9.7...v0.9.8