Releases: pgcentralfoundation/pgrx
v0.1.7
This is pgx
v0.1.7. It is a minor release that fixes a few edge-case bugs with cargo-pgx
and also adds a few more Postgres header bindings.
To upgrade, please run:
$ cargo install cargo-pgx
And don't forget to update your own Cargo.toml
dependency versions.
Bugs Fixed:
- Issue #67: Provide better error messages when an extension name doesn't contain valid characters
- Issue #68: Provide better error messages when the
./sql
directory can't be found
New Postgres Headers
- added
commands/comment.h
- added
rewrite/rewriteHandler.h
Please Sponsor Our Work
While a labor of love, pgx
development is not without cost. Please consider sponsoring our work to offset those costs. All sponsorship tiers are appreciated.
Also, feel free to join our Discord: https://discord.gg/QN2AmFV
v0.1.6
This is pgx
v0.1.6. It's a minor release that adds a few more Postgres header files to its bindings.
It also improves the SpiHeapTupleData
type so that it can be indexed by field name or field number.
As always, make sure to update cargo-pgx
via:
$ cargo install cargo-pgx
Please Sponsor Our Work
Developing pgx
is quite a lot of work. We appreciate your sponsorships to help keep us motivated and moving pgx
forward.
v0.1.5
This is pgx
v0.1.5. It is a minor release to fix some bugs and performance issues.
As always, in addition to updating your Cargo.toml versions, please make sure to run the following to upgrade to this version:
$ cargo install cargo-pgx
Changes
- bf990c1: The input/output functions for custom types are now marked
PARALLEL SAFE
- Issue #58:
pgx
no longer sets asearch_path
for all created functions. If your function needs a search_path, there's a new#[search_path(...)]
macro you can apply to that function. It's applicable to#[pg_extern]
,#[pg_operator]
and#[pg_test]
- 8549258: Fix a few memory leaks related to converting
jsonb
Datums - 8549258: Add a new variant to
PgMemoryContexts
along with a few other helper functions
Sponsor Our Work
Please consider sponsoring pgx
' development by clicking here. We greatly appreciate it!
v0.1.4
This is pgx
v0.1.4. It's a follow-up to v0.1.3 so that the docs build on docs.rs and that cargo pgx test
correctly works.
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.
v0.1.3
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 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.
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.
v0.0.18
This is pgx
v0.0.18. It is a minor bugfix release.
As always, please make sure to run:
$ cargo install cargo-pgx
to upgrade to this version.
Changes
- Fix a memory leak with
PgVarlena
when constructed from a non-toasted datum pgx
now generatesDisplay
implementations for most of the internal Postgrespg_sys::Node
types usingpg_sys::nodeToString()
cargo pgx new
no longer initializes the extension directory as a git repo. It does, however, continue to generate a.gitignore
file- Fix a bug with
build.rs
where it wasn't properly building the c-shim #[no_mangle]
is now required on the "background_worker_main" function when using BgWorker supportbuild.rs
now generates a graph of Postgres struct inheritance, opening up the possibility for future programmatic transformations
Thanks!
Thanks to everyone that contributed a PR or filed a bug report. Also, thanks to our sponsors. Sponsorship helps keep us motivated, so please consider sponsoring us!
v0.0.17
This is pgx
v0.0.17. It is a minor bugfix and cleanup release.
As always, make sure to run: cargo install cargo-pgx
to update cargo-pgx to this version and also update your dependency versions.
Changes
- panic!() locations are now properly reported (again)
- Bindings for Postgres'
parser.h
- cleanup
build.rs
to avoid extra lexing and i/o during builds cargo pgx --version
now reports its version number- minor type-o fixes
Thanks!
Thanks for the Pull Requests, everyone!
v0.0.16
This is pgx
v0.0.16. It is a minor bugfix release that fixes an issue with cargo pgx
where its schema generator would copy extension SQL upgrade scripts to the wrong directory.
To update, you must run
cargo install cargo-pgx
v0.0.15
This is pgx
v0.0.15. It contains a number of fixes and new features.
Please make sure to update the cargo-pgx
subcommand to v0.0.15 by running:
$ cargo install cargo-pgx
New Features
-
Returning a
Vec<T> where T: PostgresType
from a#[pg_extern]
function is now supported -
When building
pgx
iself, failing to specify the Postgres version feature (ie, --features "pg12") now results in one compilation error instead of thousands. -
pgx
's schema generator now applies asearch_path
setting to every#[pg_extern]/#[pg_operator]
function it generates. This change now requires that extensions berelocatable = false
. This is set in the extension's.control
file and needs to be updated as the previous default wastrue
. Failure to do so will result in an error duringpgx
's schema generation phase. -
Postgres versions are updated to the latest point releases. If you'd like to also upgrade to those, simply re-run
cargo pgx init
. Your existing databases will be preserved. -
cargo pgx test
now has a--release
flag. -
Invent
cargo pgx connect pgXX
to connect to the specific Postgres instance without compiling/installing an extension. -
New
#[derive(PostgresEq, PostgresOrd, PostgresHash)
traits for automatically generating semantically equivalent Postgres operator functions, along with operator classes/families, allowing such types to be used in Postgresbtree
andhash
indices. -
The
extension_sql!()
macro is validated at compile time. -
Safe support for Postgres' Shared Memory and LWLock system. We currently support custom types (Copy/Clone), types from
heapless
, and standard Rust atomics -- allowing for safe usage of these types across Postgres backends. -
The
_PG_init()
and_PG_fini()
functions now only need#[pg_guard]
applied. It is no longer necessary to apply#[allow(non_snake_case)]
to avoid compiler warnings.
Fixes
-
pgx
's schema generator now processes.rs
files in alphabetical order to
ensure consistency across platforms/filesystems -
Adjust the order in which DDL objects are generated
-
Functions behind
#[pg_guard]
are no longer allowed to be called by threads. Doing so will result in apanic!()
. This ensures, at runtime, that function calls to Postgres only happen on the main thread. This check is disabled in--release
builds to avoid runtime overhead in such builds. -
panic!()
s from threads are logged to stderr (which should go to your Postgres log file), rather than being converted into Postgresereport(ERROR)
s.