Releases: pgcentralfoundation/pgrx
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
v0.10.0-beta.0
Welcome to pgrx v0.10.0-beta.0.
This is a big release in that it brings PostgreSQL 16 Beta 2 support along with a few bug fixes.
🎉 This is also our first release under the stewardship of the PgCentral Foundation 🎉
If you'd like to help beta test please install cargo-pgrx with:
# cargo install cargo-pgrx --version 0.10.0-beta.0 --locked`
and then run
cargo pgrx init
to get the pgrx-managed version of Postgres 16beta2 locally installed.
This pgrx release is a beta because of the new Postgres 16beta2 support. There's some new infrastructure in the code for managing Postgres beta releases which will hopefully make it easy down the road when Postgres 17 comes around. So we'd like to make sure that's working on computers that aren't ours in addition to generally making sure the pgrx-specific changes to support 16beta2 are solid.
However, after a couple of pgrx v0.10.0 beta releases, we'll release the final version regardless of the Postgres 16 state. We'll simply continue to include the latest 16 beta/rc and publish point releases as 16 progresses.
When 16 is finally GA, we'll add that to whatever the latest pgrx release happens to be at that time.
Postgres 16 Beta2 Support
pgrx v0.10.0-beta.0 is the first pgrx release to support the new Postgres Beta series. Note that this release is tied to 16beta2, and a new pgrx release will need to be done for any subsequent 16 betas or release candidates. We intend to support these in a timely manner.
Note that pgrx only understands pg16
as the Postgres version feature flag. It is not possible for pgrx or pgrx-based extensions to support multiple betas at the same time.
You'll want to run a cargo pgrx init
to get the support, if you want it.
Using pg16beta2 is a simple matter of adding:
pg16 = ["pgrx/pg16", "pgrx-tests/pg16" ]
to the [features]
block of your Cargo.toml
files and then targeting pg16
instead of any other version.
In general, there aren't a lot of user-facing internal Postgres API changes between 15 and 16, but there are some, so it's possible you'll need some #[cfg(feature = "pg16")]
directives.
One breaking change that impacts pgrx across all supported versions is that string GUCs are now represented as GucSetting<Option<&'static CStr>>
. Previously they were GucSetting<Option<&'static str>>
which is a) strictly incorrect and b) incompatible with pg16.
If you find any issues with 16beta2 support, please file issues here on GitHub.
- Postgres 16beta1 Support by @eeeebbbbrrrr in #1169
- list specific versions in feature gates by @eeeebbbbrrrr in #1175
beta1 support was soon replaced by:
- update to pg16beta2 support by @eeeebbbbrrrr in #1188
Bug Fixes
- Support building against macOS universal binaries by @clowder in #1166
- fcinfo: fix incorrect length set in unsafe code by @Sasasu in #1190
- Array-walking is aligned by @workingjubilee in #1191
CI Changes
- Fixes macos-11 tests by @BradyBonnette in #1197
- Disable hello_versioned_so test by @workingjubilee in #1192
This test has been causing our CI some trouble -- we are investigating why
New Features
- Include security labels header by @daamien in #1189
- Implement PGRXSharedMemory for Deque by @feikesteenbergen in #1170
Misc Changes
- doc: fix link broken by @yihong0618 in #1181
- PgCentral Foundation copyright updates by @eeeebbbbrrrr in #1200
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
Thanks
Thanks to @ChronicallyJD and the @pgcentralfoundation for their stewardship. We're looking forward to a bright future of extending Postgres with Rust!
Full Changelog: v0.9.7...v0.10.0-beta.0
v0.9.7
This is pgrx v0.9.7. It fixes an important bug when working with arrays that have leading NULL elements. Such arrays could lead to spurious Postgres errors or even crashes when iterating.
Please upgrade your pgrx projects as soon as you can, making sure to update your crate dependencies and to cargo install cargo-pgrx --locked
.
What's Changed
PR #1180 - Arrays with leading NULL values are now properly advanced during iteration.
Thanks!
Big thanks to @workingjubilee for some late-night debugging!
Full Changelog: v0.9.6...v0.9.7
v0.9.6
This is an "out of band" patch release for a v0.9.6, based directly off v0.9.5. This release fixes a bug with Datum
to Date
conversions. Unfortunately, this bug essentially manifests itself as a Y2K bug where dates prior to 2000-01-01, when used in an Array<Date>
fail to convert.
When updating, please make sure to cargo install cargo-pgrx --locked
and update your crate dependencies to v0.9.6.
What's Changed
- PR #1177: Cast Date Datums to
pg_sys::DateADT
(i32
) instead ofisize
Full Changelog: v0.9.5...v0.9.6
v0.9.5
This is pgrx v0.9.5. It contains no code changes. It simply under-specifies its dependency on serde
in an effort to make serde
easier to use by pgrx-based crates.
As always, please update cargo-pgrx with cargo install cargo-pgrx --locked
and also update your extension crate dependencies.
What's Changed
- Underspecify rather than overspecify the serde/serde_json/serde_derive versions we require by @thomcc in #1167
Full Changelog: v0.9.4...v0.9.5
v0.9.4
Welcome to pgrx v0.9.4. It is a minor bugfix release resolving an issue returning a TableIterator
with only 1 field.
As always, please update with cargo install cargo-pgrx --locked
and update your crate dependencies.
What's Changed
- Properly Support
RETURNS TABLE (T)
(returning a table with 1 field) by @eeeebbbbrrrr in #1164. This closes Issue #1031 and #1091 - Remove
pgrx/Cargo.toml
dependency on thetime
crate 579f29f
Full Changelog: v0.9.3...asdf
v0.9.3
pgrx v0.9.3 is a minor update that resolves some issues with the relatively new zero-copy array support. There are no user-facing changes in this release.
As always, please install it with cargo install cargo-pgrx --locked
and update your dependencies accordingly.
What's Changed
- Teach
Array
how to work with Arrays of arbitrary fixed-sizes that are also pass-by-value by @eeeebbbbrrrr in #1161 - Simplify and fix some correctness issues with fixed-size byval arrays by @thomcc in #1162
Full Changelog: v0.9.2...v0.9.3
v0.9.2
This is pgrx v0.9.2. It's a minor release fixing a few bugs related to the PgVarlena
type and the PostgresEq/Ord/Hash
derive macros. It also now allows a #[pg_extern]
function to return Result<Option<TableIterator<...>>>
.
As always, make sure to cargo install cargo-pgrx --locked
and update your Cargo.toml
dependencies.
Bug Fixes
PgVarlena
-based types are now correctly used by#[derive(PostgresEq/Ord/Hash)]
by @eeeebbbbrrrr in #1159
There's a new example in pgrx-examples/src/pgvarlena.rs
that demonstrates how to take advantage of all the DDL pgrx can generate for this combination of features.
- Fix parsing bugs with
#[pg_extern]
in ff89c01
Miscellaneous Changes
New Contributors
Full Changelog: v0.9.1...v0.9.2
v0.9.1
This is pgrx v0.9.1. It's a minor point release.
What's Changed
cargo pgrx init
can now accept configure flags to pass to each Postgres version it builds. This can be helpful for properly configuring other contrib/
packages that are otherwise installed.
- do some cleanups around
PgHeapTuple
to make it easier to use by @eeeebbbbrrrr in #1153
This adds the ability to construct an empty PgHeapTuple
from the underlying type Oid. It also marks one of its constructor functions as unsafe
. The latter might be considered a breaking API change, but it's such a minor thing that it's not worth a full semver bump.
Full Changelog: v0.9.0...v0.9.1
v0.9.0
Welcome to pgrx
v0.9.0. This is a big release as it brings significantly improved date and time support, which includes some breaking API changes for those types.
When upgrading, make sure to update your Cargo.toml
files and also cargo install cargo-pgrx --locked
.
Improved Date, Time, Interval Support
v0.9.0 adds quite a bit of functionality around pgrx
' date/time/interval handling (#1139). The various Date
, Time
, TimeWithTimeZone
, Timestamp
, TimestampWithTimeZone
, and Interval
types can now:
- be constructed through code in various ways
- converted between each other where approporiate
- have math operations performed on them (ie, adding a
date + time
results in aTimestamp
, addingtime + interval
results in a new time, etc) - be formatted as strings for display purposes using Postgres output functions
- be serialized/deserialized with
serde
as ISO-conforming "json" strings using Postgres formatting - have their individual parts extracted
- much more!
In doing this, we've removed the time-crate
feature flag. pgrx
has no plans to continue to support the external time
crate or even chronos
. The new built-in functionality is very complete. Should more work be required we'd prefer to do it here and rely on Postgres to do the actual date/time math code correctly.
There's also a new example (pgrx-examples/datetime/
) showing off some of the new capabilities.
Array Support
Arrays have gotten a little more love. Arrays of non-null primitive types can now be represented as slices, which can help to drastically improve random access and iteration performance.
- Optimize zero-copy arrays around fixed-size types by @eeeebbbbrrrr in #1145
- Add Array slice support for primitive types (i8/16/32/64, f32/64) by @eeeebbbbrrrr in #1147
- don't free the backing Array Datum pointer on drop, even if it was detoasted by @eeeebbbbrrrr in #1149 (related to issue #971)
- Few small array changes by @thomcc in #1148
Additional Bindings
- include generic xlog related api by @kemingy in #1135
- Add lock manager related api by @usamoi in #1140
Stability/Correctness issues
- Within the NUMERIC support code, stop comparing function pointers by @eeeebbbbrrrr in #1138
- fix issue #1141: immediately report FATAL and PANIC by @eeeebbbbrrrr in #1142
- Fix errant SQL generation for Aggregates by @phlay in #1134
Testing Framework
- Wait for postmaster.pid during
cargo pgrx test
by @eeeebbbbrrrr in #1150
Dependencies
- upgrade all dependencies (except for
syn
) to their latest versions by @eeeebbbbrrrr in #1151
New Contributors
Full Changelog: v0.8.4...v0.9.0