Re: Relative ordering in array aggregation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: prakashn(at)uci(dot)edu
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Relative ordering in array aggregation
Date: 2011-02-10 00:33:35
Message-ID: 16259.1297298015@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

prakashn(at)uci(dot)edu writes:
> I'm using 8.3.3. I came across the array_accum aggregate function in
> the docs:
> http://www.postgresql.org/docs/8.3/interactive/xaggr.html

> This would be very useful to me, but I have a question about ordering
> of values. If I use more than one array_accum in the same select
> clause, is there any reliable correspondence between the order of
> elements in the returned arrays?

As long as you don't use DISTINCT (or, in more recent versions than 8.3,
within-aggregate ordering of the input rows), all aggregates in the same
SELECT list should receive the input rows in the same order.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua Tolley 2011-02-10 01:02:49 Re: How to retrieve values of 'array' field using C library (libpq)
Previous Message Carlos Mennens 2011-02-10 00:29:40 Storing Media Types