frkn_avg
C aggregate extension providing my_avg for bigint and floating-point inputs.
Aggregate-Average · C aggregate extension providing my_avg for bigint and floating-point inputs.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100215 | frkn_avg | Aggregate-Average | 0.0.1 | FUNC | Unknown | C |
Usage
Sources:
frkn_avg defines my_avg(bigint) and my_avg(float) aggregates backed by a custom my_state C type. Both accumulate their sum and count using single-precision fields.
This implementation is experimental and has material correctness hazards: the SQL bigint transition is read with a 32-bit C accessor, floating-point input is narrowed, and state precision degrades as values or row counts grow. The declared internal length also differs from the two-float C structure. Do not expose it to untrusted workloads or use it for financial or exact analytics; compare results against PostgreSQL avg on representative data first.