Skip to content

Deprecate pgrx::hooks without replacement#1752

Merged
workingjubilee merged 1 commit into
pgcentralfoundation:developfrom
workingjubilee:deprecate-hooks-api-without-replacement
Aug 20, 2024
Merged

Deprecate pgrx::hooks without replacement#1752
workingjubilee merged 1 commit into
pgcentralfoundation:developfrom
workingjubilee:deprecate-hooks-api-without-replacement

Conversation

@workingjubilee

Copy link
Copy Markdown
Member

Even if we could fix this with internal refactors, I think it's a sufficiently bad pattern, and sufficiently hard to reason about the soundness of it, that we should just tell people to drop this API.

@daamien

daamien commented Jul 8, 2024

Copy link
Copy Markdown
Contributor

As far as I understand, this is going to break any PGRX extension that defines PostgresQL hooks ? Seems like a radical choice, given that there may be some of these hook-based extensions currently in production... What would be the best approach for them ? Staying in version 0.11 indefinetely with no support for Postgres 17+ or maybe something like #[allow(pgrx::hooks)] ?

@workingjubilee

Copy link
Copy Markdown
Member Author

@daamien you can just allow(deprecated). warnings don't prevent anything from compiling.

@workingjubilee

Copy link
Copy Markdown
Member Author

My only hesitation for committing this at the moment is currently I'm also using deprecations to communicate about other things that can be effectively replaced, so I am reluctant to fill the deprecation notices with even more.

@workingjubilee

Copy link
Copy Markdown
Member Author

I've decided I'm only going to merge this deprecation notice after I cut 0.12.0 proper, as otherwise a bunch of useful deprecation notices will be shadowed by one kinda useless one (I feel the request is a bit unfair, even if it's true it's more sound code).

@workingjubilee workingjubilee force-pushed the deprecate-hooks-api-without-replacement branch from 575dc94 to a217272 Compare August 20, 2024 20:00
@workingjubilee workingjubilee merged commit 1f85733 into pgcentralfoundation:develop Aug 20, 2024
@workingjubilee workingjubilee deleted the deprecate-hooks-api-without-replacement branch August 20, 2024 20:56
@yrashk

yrashk commented Sep 19, 2024

Copy link
Copy Markdown
Contributor

To keep some decision-making trail, is it fair to note that #1749 would be a good reference for the problems discussed here?

usamoi pushed a commit to tensorchord/pgrx that referenced this pull request Mar 6, 2025
Even if we could fix this with internal refactors, I think it's a
sufficiently bad pattern, and sufficiently hard to reason about the
soundness of it, that we should just tell people to drop this API.
@usamoi usamoi mentioned this pull request Aug 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants