v0.1.2
This is pgx
v0.1.2. 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 tocargo pgx init
(see the cargo-pgx docs)- a new trait
pgx::pg_sys::AsPgCStr
has been added to make it easy to convert&str
andString
types topalloc'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 theirCargo.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, theplanner_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.