github pgcentralfoundation/pgrx v0.1.3

latest releases: v0.12.5, v0.12.4, v0.12.3...
3 years ago

This is pgx v0.1.3. It's a follow-up to v0.1.2 so that the docs build on docs.rs.

This is somewhat of a breaking release in that it requires you to update your Cargo.toml files to define more features, and it also might necessitate some minor API changes within your code.

To upgrade, you need to run:

$ cargo install cargo-pgx

If you want Postgres 13 support, you'll then want to run:

$ cargo pgx init

New Features

  • Now also supports Postgres v13
  • cargo-pgx and the build system have been updated to not require multiple versions of Postgres be downloaded/managed. If you only need support for one or more specific versions of Postgres, you can specify those versions to cargo pgx init (see the cargo-pgx docs)
  • a new trait pgx::pg_sys::AsPgCStr has been added to make it easy to convert &str and String types to palloc'd char *s.

Breaking Changes

  • For any extensions you might have that used earlier versions of pgx, you'll need to update the [features] section in their Cargo.toml file to include the following:
[features]
default = [ "pg12" ]  # or whatever you'd prefer for your extension
pg10 = [ "pgx/pg10", "pgx-tests/pg10" ]
pg11 = [ "pgx/pg11", "pgx-tests/pg11" ]
pg12 = [ "pgx/pg12", "pgx-tests/pg12" ]
pg13 = [ "pgx/pg13", "pgx-tests/pg13" ]
pg_test = [ ]

Basically, the change here is that that pgx-tests crate now requires a Postgres version feature flag. This is a result of a change to how Postgres 13 describes extension function compatibility via pgx's pg_module_magic!() macro.

  • If you implement the pgx::PgHooks trait, the planner_hook() function's second argument is now: query_string: *mut std::os::raw::c_char. In Postgres <13, this will be a null pointer. In Postgres 13+, this will be a "char *" to the query string being planned.

Don't miss a new pgrx release

NewReleases is sending notifications on new releases.