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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

zilder
Copy link

@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 marked this pull request as ready for review November 4, 2024 14:45
@Jo0
Copy link

Jo0 commented Nov 4, 2024

Thank you so much for handling this!

bors.toml Outdated
@@ -1,17 +1,19 @@
status = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use bors anymore; this whole file can be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I removed the file

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
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