Search Postgresql Archives

Re: How do you decide what aggregates to add?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Seamus Abshere <seamus@xxxxxxxxxxx> 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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux