Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to pgrx 0.12.6 with PostgreSQL 17 support #14

Open
Vonng opened this issue Oct 19, 2024 · 4 comments
Open

Bump to pgrx 0.12.6 with PostgreSQL 17 support #14

Vonng opened this issue Oct 19, 2024 · 4 comments

Comments

@Vonng
Copy link

Vonng commented Oct 19, 2024

No description provided.

@carderne
Copy link
Owner

Could you submit a PR?

@Vonng
Copy link
Author

Vonng commented Oct 19, 2024

I'm trying to bump upid's pgrx version as this example:

But got some non-trivial compiling error msg when trying to build with pgrx 0.12.6 and PostgreSQL 16/17:

error[E0119]: conflicting implementations of trait `pgrx::IntoDatum` for type `upid`
  --> upid_pg/src/lib.rs:31:5
   |
31 |     PostgresType, PostgresEq, PostgresHash, PostgresOrd, Debug, PartialEq, PartialOrd, Eq, Hash, Ord,
   |     ^^^^^^^^^^^^ conflicting implementation for `upid`
...
55 | impl IntoDatum for upid {
   | ----------------------- first implementation here
   |
   = note: this error originates in the derive macro `PostgresType` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `pgrx::FromDatum` for type `upid`
  --> upid_pg/src/lib.rs:31:5
   |
31 |     PostgresType, PostgresEq, PostgresHash, PostgresOrd, Debug, PartialEq, PartialOrd, Eq, Hash, Ord,
   |     ^^^^^^^^^^^^ conflicting implementation for `upid`
...
67 | impl FromDatum for upid {
   | ----------------------- first implementation here
   |
   = note: this error originates in the derive macro `PostgresType` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `upid: serde::ser::Serialize` is not satisfied
   --> upid_pg/src/lib.rs:31:5
    |
31  |     PostgresType, PostgresEq, PostgresHash, PostgresOrd, Debug, PartialEq, PartialOrd, Eq, Hash, Ord,
    |     ^^^^^^^^^^^^ the trait `serde::ser::Serialize` is not implemented for `upid`, which is required by `&upid: serde::ser::Serialize`
    |
    = note: for local types consider adding `#[derive(serde::Serialize)]` to your `upid` type
    = note: for types from other crates check whether the crate offers a `serde` feature flag
    = help: the following other types implement trait `serde::ser::Serialize`:
              &'a T
              &'a mut T
              ()
              (T,)
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
            and 148 others
    = note: required for `&upid` to implement `serde::ser::Serialize`
note: required by a bound in `cbor_encode`
   --> /home/vagrant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pgrx-0.12.6/src/datum/varlena.rs:383:8
    |
381 | pub unsafe fn cbor_encode<T>(input: T) -> *const pg_sys::varlena
    |               ----------- required by a bound in this function
382 | where
383 |     T: Serialize,
    |        ^^^^^^^^^ required by this bound in `cbor_encode`
    = note: this error originates in the derive macro `PostgresType` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `upid: serde::de::Deserialize<'_>` is not satisfied
   --> upid_pg/src/lib.rs:31:5
    |
31  |     PostgresType, PostgresEq, PostgresHash, PostgresOrd, Debug, PartialEq, PartialOrd, Eq, Hash, Ord,
    |     ^^^^^^^^^^^^ the trait `serde::de::Deserialize<'_>` is not implemented for `upid`, which is required by `Option<upid>: serde::de::Deserialize<'_>`
    |
    = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `upid` type
    = note: for types from other crates check whether the crate offers a `serde` feature flag
    = help: the following other types implement trait `serde::de::Deserialize<'de>`:
              &'a [u8]
              &'a std::path::Path
              &'a str
              ()
              (T,)
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
            and 153 others
    = note: required for `Option<upid>` to implement `serde::de::Deserialize<'_>`
note: required by a bound in `cbor_decode`
   --> /home/vagrant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pgrx-0.12.6/src/datum/varlena.rs:402:8
    |
400 | pub unsafe fn cbor_decode<'de, T>(input: *mut pg_sys::varlena) -> T
    |               ----------- required by a bound in this function
401 | where
402 |     T: Deserialize<'de>,
    |        ^^^^^^^^^^^^^^^^ required by this bound in `cbor_decode`
    = note: this error originates in the derive macro `PostgresType` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0119, E0277.
For more information about an error, try `rustc --explain E0119`.
error: could not compile `upid_pg` (lib) due to 4 previous errors
error: Bad exit status from /var/tmp/rpm-tmp.yjC4mU (%build)

Which is beyond my capability to fix.

@carderne
Copy link
Owner

Ok I'll need to have a look at this, may take me a few days to find the time.

@carderne
Copy link
Owner

carderne commented Dec 8, 2024

Only just got to looking at this now.

There are quite a few breaking changes in pgrx>=0.12.0 and I'm not sure when I'll get the time to figure out how to fix them...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants