On 5/12/2021, at 9:04 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: > So that probably means that you weren't careful about allocating your > own state data in the long-lived context (agg_context), and so it > got freed between calls.
It turns out I wasn’t careful about setting isnull on the passed in state argument. After I fixed that [1] everything appears to be running smoothly! — m@ [1] https://github.com/SolarNetwork/aggs_for_vecs/commit/a734ab211f9660f8a5a3d13870f089b46df56e7c