Skip site navigation (1) Skip section navigation (2)

Re: array_agg and array_accum (patch)

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ian Caulfield <ian(dot)caulfield(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: array_agg and array_accum (patch)
Date: 2008-10-31 06:19:15
Message-ID: 1225433955.1375.136.camel@jdavis (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, 2008-10-29 at 00:08 -0400, Robert Haas wrote:
> It's worth noting that this is the third version of this idea that has
> been submitted.  Ian Caulfield submitted a patch to add this, and so
> did I.  Someone should probably look at all three of them and compare.
> 

If we include a function named array_accum(), it should return an empty
array on no input to match the function in the docs:

http://www.postgresql.org/docs/8.3/static/xaggr.html

Your function returns NULL on no input, which seems more like
array_agg().

Aside from that, I'm pretty open to anything, as long as one of our
patches makes it. If there are potential problems with the standard
(where we don't want to implement a violation), we should just do
array_accum(). If not, we might as well do the standard array_agg(),
perhaps without the ORDER BY clause.

We could also do both, because it is a little annoying to coalesce the
result or array_agg().

Regards,
	Jeff Davis



In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2008-10-31 06:33:02
Subject: Re: BufferAccessStrategy for bulk insert
Previous:From: Tom LaneDate: 2008-10-31 05:29:05
Subject: Re: can we create a record of more than one field?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group