Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tags: williandener/pgrx

Tags

v0.11.4

Toggle v0.11.4's commit message
bump version to 0.11.4

v0.12.0-alpha.1

Toggle v0.12.0-alpha.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release pgrx 0.12.0-alpha.1 (pgcentralfoundation#1598)

Welcome to pgrx 0.12.0-alpha.1!

Say the magic words with me!

```shell
cargo install cargo-pgrx --locked --version 0.12.0-alpha.1
```

# Breaking Changes

## No more dlopen!

Perhaps the most exciting change this round is @usamoi's contribution in
pgcentralfoundation#1468 which means that
we no longer perform a `dlopen` in order to generate the schema. The
cost, such as it is, is that your pgrx extensions now require a
`src/bin/pgrx_embed.rs`, which will be used to generate the schema. This
has much less cross-platform issues and will enable supporting things
like `cargo binstall` down the line.

It may be a bit touchy on first-time setup for transitioning older
repos. If necessary, you may have to directly add a
`src/bin/pgrx_embed.rs` and add the following code (which should be the
only code in the file, though you can add comments if you like?):

```rust
::pgrx::pgrx_embed!();
```

Your Cargo.toml will also want to update its crate-type key for the
library:
```toml
[lib]
crate-type = ["cdylib", "lib"]
```

## Library Code

- pgrx-pg-sys will now use `ManuallyDropUnion` thanks to @NotGyro in
pgcentralfoundation#1547
- VARHDRSZ `const`s are no longer `fn`, thanks to @workingjubilee in
pgcentralfoundation#1584
- We no longer have `Interval::is_finite` since
pgcentralfoundation#1594
- We translate more `*_tree_walker` functions to the same signature
their `*_impl` version in Postgres 16 has:
pgcentralfoundation#1596
- Thanks to @eeeebbbbrrrr in
pgcentralfoundation#1591 we no longer have
the `pg_sql_graph_magic!()` macro, which should help with more things in
the future!

# What's New

We have quite a lot of useful additions to our API:

- `SpiClient::prepare_mut` was added thanks to @XeniaLu in
pgcentralfoundation#1275
- @usamoi also contributed bindings subscripting code in
pgcentralfoundation#1562
- For `#[pg_test]`, you have been able to use `#[should_panic(expected =
"string")]` to anticipate a panic that contains that string in that
test. For various reasons, `#[pg_test(error = "string")]` is much the
same. Now, you can also use `#[pg_test(expected = "string")]`, in the
hopes that is easier to stumble across, as of
pgcentralfoundation#1570

## `Result<composite_type!("..."), E>` support

- In pgcentralfoundation#1560 @NotGyro
contributed support for using `Result<composite_type!("Name"), E>`, as a
case that had not been handled before.

## Significantly expanded docs
Thanks to @rjuju, @NotGyro, and @workingjubilee, we now have
significantly expanded docs for cargo-pgrx and pgrx in general. Some of
these are in the API docs on https://docs.rs or the READMEs, but there's
also a guide, now! It's not currently published, but is available as an
[mdbook](https://github.com/rust-lang/mdBook) in the repo.

Some diagnostic information that is also arguably documentation, like
comments and the suggestion to `cargo install`, have also been improved,
thanks to @workingjubilee in
- pgcentralfoundation#1579
- pgcentralfoundation#1573

## `#[pg_cast]`

An experimental macro for a `CREATE CAST` was contributed by @xwkuang5
in pgcentralfoundation#1445!

## Legal Stuff

Thanks to @the-kenny in
pgcentralfoundation#1490 and
@workingjubilee in
pgcentralfoundation#1504, it was brought to
our attention that some dependencies had unusual legal requirements. So
we fixed this with CI! We now check our code included into pgrx-using
binaries is MIT/Apache 2.0 licensed, as is common across crates.io,
using `cargo deny`!. The build tools will have more flexible legal
requirements (partly due to the use of Mozilla Public License code in
rustls).

# Internal Changes
Many internal cleanups were done thanks to
- @workingjubilee in too many PRs to count!
- @thomcc found a needless condition in
pgcentralfoundation#1501
- @nyurik in too many PRs to count!

In particular:
- we now actually `pfree` our `Array`s we detoasted as-of
pgcentralfoundation#1571
- creating a `RawArray` is now low-overhead due to
pgcentralfoundation#1587

## Soundness Fixes
We had a number of soundness issues uncovered or have added more tests
to catch them.
- Bounds-checking debug assertions for array access by @NotGyro in
pgcentralfoundation#1514
- Fix unsound `&` and `&mut` in `fcinfo.rs` by @workingjubilee in
pgcentralfoundation#1595

## Less Deps
Part of the cleanup by @workingjubilee was reducing the number of deps
we compile:
* cargo-pgrx: reduce trivial dep usages in
pgcentralfoundation#1499
* Update 2 syn in pgcentralfoundation#1557

Hopefully it will reduce compile time and disk usage!

## New Contributors
* @the-kenny made their first contribution in
pgcentralfoundation#1490
* @xwkuang5 made their first contribution in
pgcentralfoundation#1445
* @rjuju made their first contribution in
pgcentralfoundation#1516
* @nyurik made their first contribution in
pgcentralfoundation#1533
* @NotGyro made their first contribution in
pgcentralfoundation#1514
* @XeniaLu made their first contribution in
pgcentralfoundation#1275

**Full Changelog**:
pgcentralfoundation/pgrx@v0.12.0-alpha.0...v0.12.0-alpha.1

v0.12.0-alpha.0

Toggle v0.12.0-alpha.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update pgrx to 0.12.0-alpha.0 (pgcentralfoundation#1497)

Hello and welcome to The Beginning of The End!

You may have seen some largely-inscrutable rambling about "object
lifetimes" and "memory contexts" from me in various comments, logs, and
issues. You may have also heard that this has effectively stalled all
forward feature work. You may have noticed this has been the case for
months now.

The long and short of it is that pgrx never actually fully built-in the
actual lifetimes of objects in Postgres into its various types. As more
and more interlocking parts grew, between things like the type unboxing
in `trait FromDatum`, or the bounded memory context of `Spi::connect`,
eventually many supposedly-safe interfaces arose which proved wildly
unsafe in reality due to this mesh of interactions. Internal portions of
pgrx relied on expeditious hacks to ignore the growing problems, until
this rotten foundation yielded an enormous crop of soundness issues over
the year of 2023. Even when not exploitable, they prevent
otherwise-trivial enhancements in terms of speed or memory usage.

Key elements of a new foundation have landed in pgrx, which allow
ascribing lifetimes to every datum and every memory context that a
Postgres extension will encounter. There is much more work to be done to
actually make it so all Rust code has to flow through these new
interfaces. This alpha release is an extremely "preview" release to
allow assessing some of the damage from the first set of breaking
changes, so that some initial feedback and triage can occur. There will,
unfortunately, be more breaking changes on the horizon.

## Many Macros Expand Subtly Differently

If your extension now breaks in some inscrutable way that you cannot
otherwise discern, the problem is probably hidden in macro expansion.
This cannot really be diagnosed except using `cargo expand` diffed
against previous expansions. A most likely issue is that something that
previously hid a lifetime during expansion or writes it as 'static now
propagates it by name or as the anonymous '_ lifetime.

## `Datum<'src>`

There are now lifetime-bound Datums. Expect to see them in more places.

## `UnboxDatum<As<'src> = Type<'src>>`

Expect to see this or a similar signature a lot: there are new
conversion traits which use a generic associated type or similar sneaky
tactics to allow "clamping down" the lifetime to a bound, unless the
produced type is always 'static by being a simple value like `i32`.

## `&'mcx MemCx<'_>`

You will see more and more references to this type, which is a memory
context that encodes an inner invariant lifetime, in signatures. If one
of these is currently in-scope, then please remember it is always
`unsafe` to manipulate the `static mut CurrentMemoryContext` in
Postgres, but it is doubly so then. In general, when designing your own
types using pgrx, you should prefer designing code that uses a signature
like that of `MemoryContextAlloc` instead of `palloc` if you are at all
uncertain.

v0.11.3

Toggle v0.11.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release pgrx 0.11.3 (pgcentralfoundation#1496)

The pgrx 0.11.3 release addresses a few UB risks in pgrx, updates its
dependencies on many points, and includes many additional headers. It
should also now be easier to use cargo-pgrx on more-complicated network
configurations.

## New Bindings!

New bindings added thanks to
- @burmecia in pgcentralfoundation#1432
- @daamien in
  - pgcentralfoundation#1431
  - pgcentralfoundation#1485
- @rebasedming in pgcentralfoundation#1486
- @usamoi in pgcentralfoundation#1436
- @workingjubilee in
pgcentralfoundation#1453

## "...wait, that's UB?"

Two UB fixes!
- Thanks to @Lokathor in
pgcentralfoundation#1443
- Thanks to @usamoi in
pgcentralfoundation#1466

## Ergonomics

- A better `ereport!` macro in
pgcentralfoundation#1472

## Less transport-level security problems in cargo-pgrx

- We no longer secretly require rustls! Thanks to @jirutka in
pgcentralfoundation#1448
- We now use native certs if possible, even with rustls, since
pgcentralfoundation#1449

Together these should mean it's possible to actually use cargo-pgrx on
whatever your network configuration is, but you might have to use `cargo
install --no-default-features --features native-tls` to install with
native-tls (which, on Linux, means OpenSSL). By default, you will use
rustls.

## Many dependency updates

These address some largely-hypothetical security risks, but one is
particularly important: the bindgen update means we now should be
compatible with some aarch64 builds that might have failed.

- pgcentralfoundation#1492
- pgcentralfoundation#1493
- pgcentralfoundation#1494

v0.11.2

Toggle v0.11.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Prepare pgrx v0.11.2 (pgcentralfoundation#1425)

pgrx v0.11.2 is a minor release which

- makes available the storage-related API, thanks to @silver-ymz in
pgcentralfoundation#1409
- deprecates the `Oid::from_u32_unchecked` API... because it is actually
possible to do via casting in a *query*, which makes it effectively
impossible for us to not wind up providing it via some other safe API,
since the source is also an easily-Copied type. Thus you can now simply
use `From::from` for it. Thanks to @thomcc for this discovery,
implemented by @workingjubilee in
pgcentralfoundation#1374

As usual, `cargo install cargo-pgrx --version 0.11.2 --locked` and be on
your merry way!

Thanks everyone!

v0.11.1

Toggle v0.11.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Cut pgrx v0.11.1 (pgcentralfoundation#1408)

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 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!

v0.11.0

Toggle v0.11.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Update version to 0.11.0 (pgcentralfoundation#1331)

v0.10.2

Toggle v0.10.2's commit message
Enable proptest in more workflows

v0.10.1

Toggle v0.10.1's commit message
bump to v0.10.1 and upgrade dependencies

v0.10.0

Toggle v0.10.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Update version to 0.10.0 (pgcentralfoundation#1280)

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
pgcentralfoundation#1273
* Better error messages when `pg_config` isn't found. by @eeeebbbbrrrr
in pgcentralfoundation#1271
* Make `PostgresHash` also need `Eq` by @workingjubilee in
pgcentralfoundation#1264
* Memoize git hash and extension metadata by @levkk in
pgcentralfoundation#1274
* move to pg16rc1 by @eeeebbbbrrrr in
pgcentralfoundation#1276
* Fix bgworker template up to 0.10.0-beta.4 by @workingjubilee in
pgcentralfoundation#1270

## New Contributors
* @levkk made their first contribution in
pgcentralfoundation#1274

**Changelog**:
pgcentralfoundation/pgrx@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
pgcentralfoundation#1169
* Support building against macOS universal binaries by @clowder in
pgcentralfoundation#1166
* list specific versions in feature gates by @eeeebbbbrrrr in
pgcentralfoundation#1175
* Fix bug with converting a `pg_sys::Datum` into a `pgrx::Date` by
@eeeebbbbrrrr in pgcentralfoundation#1177
* Fix Arrays with leading nulls by @eeeebbbbrrrr in
pgcentralfoundation#1180
* Disable hello_versioned_so test by @workingjubilee in
pgcentralfoundation#1192
* doc: fix link broken by @yihong0618 in
pgcentralfoundation#1181
* fcinfo: fix incorrect length set in unsafe code by @Sasasu in
pgcentralfoundation#1190
* update to pg16beta2 support by @eeeebbbbrrrr in
pgcentralfoundation#1188
* Array-walking is aligned by @workingjubilee in
pgcentralfoundation#1191
* Implement PGRXSharedMemory for Deque by @feikesteenbergen in
pgcentralfoundation#1170
* Include security labels header by @daamien in
pgcentralfoundation#1189
* Fixes macos-11 tests by @BradyBonnette in
pgcentralfoundation#1197
* Pgcentralfoundation updates again by @eeeebbbbrrrr in
pgcentralfoundation#1200
* Update version to 0.10.0-beta.0 by @eeeebbbbrrrr in
pgcentralfoundation#1201
* Testing help by @eeeebbbbrrrr in
pgcentralfoundation#1203
* Type testability cleanup by @eeeebbbbrrrr in
pgcentralfoundation#1204
* Try to smartly propagate fs errors by @workingjubilee in
pgcentralfoundation#1186
* Fix issue pgcentralfoundation#1209 by @eeeebbbbrrrr in
pgcentralfoundation#1210
* Type roundtrip tests by @eeeebbbbrrrr in
pgcentralfoundation#1185
* Update version to 0.10.0-beta.1 by @eeeebbbbrrrr in
pgcentralfoundation#1213
* Add a workaround for the pg16/homebrew/icu4c situation by @thomcc in
pgcentralfoundation#1206
* Add security policy by @johnrballard in
pgcentralfoundation#1207
* `AnyNumeric` is no longer backed by Postgres-allocated memory by
@eeeebbbbrrrr in pgcentralfoundation#1216
* Modularize pgrx::spi by @workingjubilee in
pgcentralfoundation#1219
* Stop SpiClient soundness from regressing by @workingjubilee in
pgcentralfoundation#1214
* Add foreign table headers by @workingjubilee in
pgcentralfoundation#1226
* Modularize the interior of pgrx-pg-sys by @workingjubilee in
pgcentralfoundation#1227
* Initial valgrind support by @thomcc in
pgcentralfoundation#1218
* Add support for handling SIGINT and SIGCHLD from bgworker by @JelteF
in pgcentralfoundation#1229
* Ignores UI tests for MUSL environments by @BradyBonnette in
pgcentralfoundation#1235
* Add a env flag that can be set to skip `#[pg_test]`-generated tests.
by @thomcc in pgcentralfoundation#1239
* Fix issue pgcentralfoundation#1076: Properly handle dependency graph of `Result<T, _>` by
@eeeebbbbrrrr in pgcentralfoundation#1241
* Cleanup the error when cargo-pgrx version doesn't match Cargo.toml by
@eeeebbbbrrrr in pgcentralfoundation#1240
* Add operator and cache related api by @VoVAllen in
pgcentralfoundation#1242
* Addresses cargo-pgrx error reporting by @BradyBonnette in
pgcentralfoundation#1238
* Update version to 0.10.0-beta.2 by @eeeebbbbrrrr in
pgcentralfoundation#1244
* Bump cargo-metadata and clap-cargo by @thomcc in
pgcentralfoundation#1246
* Derive Clone for Inet by @JelteF in
pgcentralfoundation#1251
* Correct docs for datetime `From` impls by @workingjubilee in
pgcentralfoundation#1253
* Only enable line tables for profile.dev by @thomcc in
pgcentralfoundation#1249
* Remove references to master branch by @thomcc in
pgcentralfoundation#1243
* Ensure bindgen gets all the `cppflags` it needs (on macOS, anyway) by
@thomcc in pgcentralfoundation#1247
* update for pg16beta3 support by @eeeebbbbrrrr in
pgcentralfoundation#1254
* Update version to 0.10.0-beta.3 by @eeeebbbbrrrr in
pgcentralfoundation#1255
* Add proptest support by @workingjubilee in
pgcentralfoundation#1258
* Misc reformatting and typo fixes by @workingjubilee in
pgcentralfoundation#1260
* spi: simplify (optimize?) Datum preparation by @vrmiguel in
pgcentralfoundation#1256
* Assume commutation when deriving PostgresEq by @workingjubilee in
pgcentralfoundation#1261
* Demand Ord for PostgresOrd by @workingjubilee in
pgcentralfoundation#1262
* Fix pgrx install causing postgresql coredump by @Sasasu in
pgcentralfoundation#1263
* Update version to 0.10.0-beta.4 by @workingjubilee in
pgcentralfoundation#1267

## New Contributors
* @clowder made their first contribution in
pgcentralfoundation#1166
* @yihong0618 made their first contribution in
pgcentralfoundation#1181
* @Sasasu made their first contribution in
pgcentralfoundation#1190
* @daamien made their first contribution in
pgcentralfoundation#1189
* @johnrballard made their first contribution in
pgcentralfoundation#1207
* @VoVAllen made their first contribution in
pgcentralfoundation#1242
* @vrmiguel made their first contribution in
pgcentralfoundation#1256


**Full Changelog**:
pgcentralfoundation/pgrx@v0.9.8...v0.10.0