Re: Relative ordering in array aggregation - Mailing list pgsql-general

From Tom Lane
Subject Re: Relative ordering in array aggregation
Date
Msg-id 16259.1297298015@sss.pgh.pa.us
Whole thread Raw
In response to Relative ordering in array aggregation  (prakashn@uci.edu)
List pgsql-general
prakashn@uci.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

pgsql-general by date:

Previous
From: Carlos Mennens
Date:
Subject: Storing Media Types
Next
From: Joshua Tolley
Date:
Subject: Re: How to retrieve values of 'array' field using C library (libpq)