Postgres, CREATE AGGREGATE, accessing index and row count inside aggregate function for [non]oxford comma text – Postgresql
The goal is a custom aggregate function made with CREATE AGGREGATE called string_agg_oxford; it is an aggregate function that works similar to string_agg except it is smart enough to know how many items it is aggregating so that it can…