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

Upgrade to pgrx 0.12.8 and add PostgreSQL 17 support #824

Merged
merged 15 commits into from
Nov 6, 2024
Merged

Conversation

zilder
Copy link
Contributor

@zilder zilder commented Nov 4, 2024

Based on #820. Fixes compilation issues that came with pgrx 0.12.*.

Major changes:

  • Since 0.12.* pgrx does not staticize functions' return types in pg_extern macro expansion anymore. So all pg_extern functions' return types now have to explicitly use `'static' lifetime.
  • Due to the above, auto-generated _out functions in PostgresType macro do not work (do not compile) because they get their return type annotated with rust type's lifetime ('input in our case). (This may actually be a bug and should probably be addressed pgrx.) For this reason I added default implementation for _in/_out functions, as well as ArgAbi and BoxRet (it seems to be a package deal when you implement custom in/out functions)

Minor things:

  • PostgresType now requires a type to implement Serializable/Deserializable traits. As far as I understand they are used for default implementation of IntoDatum/FromDatum. Toolkit has its own implementation for these so ser/de aren't really needed. Also the default implementation of Deserializable has some conflicts with type's lifetime, so I added a trivial implementation and put unimplemented!() there as it isn't used anyway. If anyone has a better solution, pls let me know.
  • Added BoxRet implementation that is now also required by PostgresType (I just copied the one that pgrx uses for a bunch of predefined types).
  • NodeTag is now an enum hence many const => enum replacements.
  • The dependency discovery algorithm in pgrx has changed which uncovered some dependencies (between pg_extern objects that is) in toolkit haven't been set up properly causing incorrect order of DDL commands in the installation script.

@zilder zilder force-pushed the zilder/pgrx_0.12.7 branch from 5d062c4 to 74a96a9 Compare November 4, 2024 14:45
@zilder zilder marked this pull request as ready for review November 4, 2024 14:45
@Jo0
Copy link
Contributor

Jo0 commented Nov 4, 2024

Thank you so much for handling this!

bors.toml Outdated Show resolved Hide resolved
extension/src/accessors.rs Outdated Show resolved Hide resolved
extension/src/raw.rs Outdated Show resolved Hide resolved
@zilder zilder requested a review from syvb November 5, 2024 09:39
@zilder zilder merged commit 31b7ccb into main Nov 6, 2024
3 of 17 checks passed
@zilder zilder mentioned this pull request Nov 6, 2024
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

Successfully merging this pull request may close these issues.

6 participants