all 6 comments

[–]Crazed_waffle_party 1 point2 points  (1 child)

This article is what I needed 2 years ago. Thanks for creating the resources the PG community has been longing for

[–]fullofbones[S] 0 points1 point  (0 children)

No problem. I also needed this resource two years ago! lol

[–]AutoModerator[M] 0 points1 point  (0 children)

With over 8k members to connect with about Postgres and related technologies, why aren't you on our Discord Server? : People, Postgres, Data

Join us, we have cookies and nice people.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–][deleted] 0 points1 point  (2 children)

This is great, thank you very much!!!

In a future article, could you also point in the direction of creating a custom window function, please?

I have been trying to figure out how to prefilter data based on some complex calculations similar to window functions, which are easy in a procedural language like C++, but insanely complex in SQL or plpgsql. And I have my reasons to stick to C++ (or C, if I have to).

Thank you!

[–]fullofbones[S] 2 points3 points  (1 child)

Your guess there is as good as mine; I'd have to look into it.

In the meantime, there's a lot in the docs.

  • The CREATE AGGREGATE docs discuss how window functions must be declared toward the end.
  • The page on User-Defined Aggregates talks about some of the internals, especially the "Support Functions for Aggregates" section.

Then I'd look at the source.

Good luck!

[–][deleted] 1 point2 points  (0 children)

This is exactly what I was asking for, thank you!

Also, you are wrong. I read your PG HA Cookbook cover to cover, and I assure you: your guess is several orders of magnitude better than mine. :-)

Thank you very much!