Re: [GENERAL] How do you decide what aggregates to add? - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] How do you decide what aggregates to add?
Date
Msg-id 10345.1508510311@sss.pgh.pa.us
Whole thread Raw
In response to [GENERAL] How do you decide what aggregates to add?  (Seamus Abshere <seamus@abshere.net>)
List pgsql-general
Seamus Abshere <seamus@abshere.net> writes:
> Who decides if a seemingly-useful aggregate is added to Postgres?

There's no particularly well-defined process for it, but as far as
these items ago:

> 1. I just discovered first()/last() as defined in the wiki [1], where
> it's noted that conversion from Access or Oracle is much easier with
> them.

Those are (a) undefined as to precise behavior, (b) redundant with
the first_value/last_value window functions, which *are* well defined
(not to mention SQL-standard), and (c) easy enough to make in SQL if
you want them despite (a) and (b).  So I don't really see them
getting over the hump.

> 2. We use our "homemade" jsonb_object_agg(jsonb) constantly, which is
> modeled off of (built-in) json_object_agg(name, value) and (built-in)
> jsonb_agg(expression). [2]

I dunno, the semantics of using jsonb_concat as an aggregate transfn
seem pretty squishy to me.  It's certainly much less well-defined
as to what you get than for either of the existing aggs you mention.

The short answer really is that we spend a lot of sweat on making Postgres
extensible so that we don't have to put in (and then maintain forever)
every little special-purpose function somebody might want.
        regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Seamus Abshere
Date:
Subject: [GENERAL] How do you decide what aggregates to add?
Next
From: Stephen Froehlich
Date:
Subject: [GENERAL] Issues shutting down PostgreSQL 10 cleanly