-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
Relax bounds on aggregate functions? #1272
Comments
I don't believe pgrx' aggregate support requires the state function to derive Copy, so you should be able to remove it. |
When I tried to remove it, it errors saying that
|
Okay, upon further investigation, our aggregate state function is bound by Basically, that means your "state" struct needs to be a fixed size and not contain anything that also does heap allocation, such as a Vec (or a String or a HashMap, etc ,etc). It's not clear to me what you're trying to accomplish by storing |
Ahhh, the fixed size constraint makes sense. I'm gonna see if I can try to find a work around. Thank you for your help! |
After I finish with the List rework I will take a look at aggregates. Unless someone beats me to it. |
Investigating this is waiting for the new MemCx API to land, because the relaxation won't be sound otherwise. |
Hi - new to Rust and PGRX, so excuse me if my questions are a bit silly. I am trying to create an aggregate function in PGRX and I am working with the aggregate example code to get a better understanding. My goal right now is to read a column that contains text in PGSQL and to insert each piece of text into a vector that is a field in the aggregate state. However, when trying to initialize the field in the state struct, it gives me issues with some of the traits and types. This is the code I am working with now - it is the same as the aggregate example but I am just adding a vector field inside the struct to continue with testing.
When attempting to run, I get this error:
19 | #[derive(Copy, Clone, PostgresType, Serialize, Deserialize)] | ^^^^ ... 24 | inputs: Vec<String>, | ------------------- this field does not implement
std::marker::Copy``In reference to the
inputs
field I added in the struct.Any feedback would be super appreciated. Thank you so much!
The text was updated successfully, but these errors were encountered: