Writing your own aggregation functions

Many people who have used PostgreSQL or SQL in general in a professional or semi-professional way have stumbled across “aggregate functions”. A database engine such as PostgreSQL usually provides the most basic aggregate functions such as count, min, max, sum, and so on. However, those functions are pretty limited and fulfill only the basic needs […]