We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
5mins of Postgres E4: Writing your own custom Postgres aggregates with Rust or raw SQL
Summary
Description
Today we'll take a look at how to write custom aggregates in Postgres using either Rust or raw SQL and walk through the recent pgx v0.3.0 release.
Find the article on our blog here: https://pganalyze.com/blog/5mins-postgres-custom-aggregates-rust-sql-pgx
*Learn more about pganalyze:*
https://pganalyze.com/newsletter
https://twitter.com/pganalyze/
What we have discussed in this episode of 5mins of Postgres:
PostgreSQL Aggregates with Rust: https://hoverbear.org/blog/postgresql-aggregates-with-rust/
pgx v0.3.0 release: https://github.com/zombodb/pgx/releases/tag/v0.3.0
Implementing the harmonic mean and geometric mean as user-defined aggregates in PostgreSQL: https://tim.mcnamara.nz/post/177172657187/user-defined-aggregates-in-postgresql
How PostgreSQL aggregation works and how it inspired our hyperfunctions’ design: https://blog.timescale.com/blog/how-postgresql-aggregation-works-and-how-it-inspired-our-hyperfunctions-design-2/
Translated At: 2025-08-18T13:26:09Z