-
Notifications
You must be signed in to change notification settings - Fork 44
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tracking issue] Switch to upstream PGX #177
Comments
Thank you! We would very much like to be on stock upstream, and I have plans to open PRs for the remaining stuff we're relying on. I've just been a bit too overwhelmed recently to translating our stuff into things that are actually worth upstreaming 馃槗 |
We're working on a new type resolution system that is replacing cargo-pgx' Long story short -- it builds a @Hoverbear is the one doing this work and might drop by and talk a little more about it. It can even output graphviz .dot files so you can visualize your schema dependencies. Then we've got plans for auto-generating extension schema upgrade scripts, and then, the cool thing is we're gonna actually parse your I said all this because looking through your fork, I couldn't quite figure out the But please, send us PRs. Happy to merge and publish to crates.io ASAP. I don't want a situation where we've fractured the pgx community and then users get confused by pgx-proper and pgx-tsdb. |
@JLockerman Oh my gosh another test case for the new code! I'd love to chat with you about this @JLockerman ! Are you on our discord? Feel free to ping me and we can discuss! I wanna make sure the new generator can handle the features you need, too! |
@eeeebbbbrrrr oh that is very interesting!
@Hoverbear I'm on discord, but not regularly, I'll stop by to discuss, and try to be around more often. |
It's incredibly impressive, and I'm about to explain one reason why...
I got cha. Now it makes sense that there's no pgx code behind it. The new schema generator doesn't read the source .rs files at all. It instead ties into all the existing proc macros to generate the metadata necessary to build the schema. This means it'll JustWork, regardless of the fancy Rust mechanisms you use to declare a struct and add a |
I was wondering if that was the plan 馃槃 Have you had any odd interaction with incremental compilation? IIUC when and if proc-macros are run is non-deterministic in that regime, which I could see causing issues for schema generation... |
not when you build a proper dependency graph from the metadata. ;) |
Back on the topic of bringing timescale back in-sync with upstream; looking through our branches I a bunch of simple commits:
Then we have the tricky ones: the code around forwarding rust-alloc to palloc.
I think my preferred solution to these would be to add a feature flag to pgx that switches the allocator to use palloc and disables the guard, and I'd be happy to open a PR that adds it if you guys are willing to have that upstream, but I realize this isn't exactly the central use case for pgx, and I'm happy to hear other idea if you have a way you'd prefer to unify (or not unify) these. |
We'll take 'em all except for the About switching "the CurrrentMemoryContext to TopMemoryContext when setting up the panic handler" -- I saw that commit and didn't really understand why it's necessary. Could you explain a little more? Postgres should take care of this for us, no? Regardless, I don't see why this would need to be feature gated. Regarding the The changeset for that is kinda funny. I'd probably rather handle doing all of this work myself. |
This is me being unsure of what context
Yeah, I have to admit I'm not thrilled about it either, to the extent that this extension still compiles with the guards enabled. I think only people who should do it are people who really really care about performance and are willing to sacrifice on safety to get it; Promscale for instance found that the hit was bad enough that they'd rather write their extension in C rather than accept the performance hit, and that's something I'd prefer to prevent 馃槉.
Do you think something like
would work? If so I can get a start on it (unless you're talking about my current changeset, which is entirely horrible, and was a one-off for benchmarking) |
Thinking about this a little more, there may a simpler fix for our setjmp guard issue, I don't think we really care about removing the guard from internal calls to postgres functions right now, only for |
I see. Yeah, that makes sense.
Agreed, especially with the last point. Rust is where it's at.
Not sure. Haven't thought about it enough yet.
Did you try profiling with the |
I opened pgcentralfoundation/pgrx#169 with the changes to
|
I'm waiting to hear back from @cevian who did the original benchmarking. Looking through the code it never calls any postgres functions except |
going to try and test the |
Wait for beta2, which I hope will happen tomorrow. Day 3 of fighting a terrible cold. My head is gonna explode |
馃憤 will wait |
To all those following along: I'm in the process of getting the Toolkit to work on the |
A snapshot of my progress to getting the Toolkit working on stock |
We've updated to baseline |
Good work and congrats on the release! 馃帀
I noticed that y'all are using a fork of
pgx
that @JLockerman is maintaining.I looked at the commits and they mostly look reasonable. We'd appreciate some PRs so we can get your changes merged upstream. Then y'all won't need to ask your users install a version of pgx that's not compatible with upstream.
Thanks and let me know how we can help.
The text was updated successfully, but these errors were encountered: