Re: onlyvalue aggregate (was: First Aggregate Funtion?) - Mailing list pgsql-hackers

From Robert Haas
Subject Re: onlyvalue aggregate (was: First Aggregate Funtion?)
Date
Msg-id CA+TgmoaodCSSpS06yOx9djNEBvP7voSYd9KPOpmjQjM5OF_EvA@mail.gmail.com
Whole thread Raw
In response to onlyvalue aggregate (was: First Aggregate Funtion?)  (Marko Tiikkaja <marko@joh.to>)
List pgsql-hackers
On Wed, Oct 28, 2015 at 5:50 PM, Marko Tiikkaja <marko@joh.to> wrote:
> Here's a patch for the aggregate function outlined by Corey Huinker in
> CADkLM=foA_oC_Ri23F9PbfLnfwXFbC3Lt8bBzRu3=CB77G9_qw@mail.gmail.com .  I
> called it "onlyvalue", which is a horrible name, but I have nothing better
> to offer.  (Corey called it "only", but that doesn't really work since ONLY
> is a fully reserved keyword.)

I've written an aggregate that does something like this a few times.
I think one time I called it "the", which is probably too clever, but
then you could query for the(project_manager) and similar.  I've
usually written it to not error-check and just return the first
non-NULL value it runs across, which suggests a name like any_old() or
whatever().

I actually think by comparison with those ideas, onlyvalue() - or
maybe only_value() - is not bad.

> I'll add this to September's commit fest,

November, probably.

> but if you want to bash me or the
> patch in the meanwhile, go ahead.

What if we want to say nice things?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Patent warning about the Greenplum source code
Next
From: Michael Paquier
Date:
Subject: Re: September 2015 Commitfest