Skip to content

Commit

Permalink
Merge #547
Browse files Browse the repository at this point in the history
547: Upgrade to pgx 0.5.0 r=Smittyvb a=Smittyvb

Upgrades to pgx `0.5.0-beta.1` (0.5.0 will hopefully be released in 0-7 days). I originally tested on another branch with a lot of code commented out; this branch cherry picks the commits that fix errors but not the ones that comment code out.

To do:
- [x] Fix the three failing tests in `datum_utils.rs` (pgcentralfoundation/pgrx#740)
- [x] Remove workaround for lack of `Copy` on some types
- [x] Make update tester work in CI (#552)
- [x] Change pgx version from 0.5.0-beta.1 to 0.5.0
- [ ] Publish new CI docker image with pgx 0.5.0 right before merging (#571)

Future work:
- Replace `use pgx::*` with `use pgx::prelude::*`
- Use native pgx types instead of `crate::raw`
- Use `#[pg_aggregate]` instead of our own aggregate builder macro

Co-authored-by: Smitty <smitty@timescale.com>
  • Loading branch information
bors[bot] and syvb authored Oct 17, 2022
2 parents 4546419 + fe8b386 commit fa7b32f
Show file tree
Hide file tree
Showing 34 changed files with 1,074 additions and 986 deletions.
482 changes: 177 additions & 305 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ sudo apt-get install make gcc pkg-config clang postgresql-server-dev-14 libssl-d

Next you need [cargo-pgx](https://github.com/tcdi/pgx), which can be installed with
```bash
cargo install --version '=0.4.5' --force cargo-pgx
cargo install --version '=0.5.0' --force cargo-pgx
```

You must reinstall cargo-pgx whenver you update your Rust compiler, since cargo-pgx needs to be built with the same compiler as Toolkit.
Expand Down
6 changes: 3 additions & 3 deletions extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pg_test = ["approx"]
[dependencies]
# Keep synchronized with `cargo install --version N.N.N cargo-pgx` in Readme.md and docker/ci/Dockerfile
# Also `pgx-tests` down below in `dev-dependencies`.
pgx = "=0.4.5"
pgx-macros = "=0.4.5"
pgx = "=0.5.0"
pgx-macros = "=0.5.0"
encodings = {path="../crates/encodings"}
flat_serialize = {path="../crates/flat_serialize/flat_serialize"}
flat_serialize_macro = {path="../crates/flat_serialize/flat_serialize_macro"}
Expand Down Expand Up @@ -52,5 +52,5 @@ spfunc = "0.1.0"
statrs = "0.15.0"

[dev-dependencies]
pgx-tests = "=0.4.5"
pgx-tests = "=0.5.0"
approx = "0.4.0"
2 changes: 1 addition & 1 deletion extension/src/accessors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ ron_inout_funcs!(AccessorWithBounds);

#[pg_extern(immutable, parallel_safe, name = "with_bounds")]
pub fn accessor_with_bounds(bounds: crate::raw::tstzrange) -> AccessorWithBounds<'static> {
let range = unsafe { crate::range::get_range(bounds.0 as *mut pg_sys::varlena) };
let range = unsafe { crate::range::get_range(bounds.0.cast_mut_ptr()) };
let mut accessor = build! {
AccessorWithBounds {
lower: 0,
Expand Down
Loading

0 comments on commit fa7b32f

Please sign in to comment.