is 8.4 array_agg() supposed to work with array values? - Mailing list pgsql-hackers

From Todd A. Cook
Subject is 8.4 array_agg() supposed to work with array values?
Date
Msg-id 4974EF0D.8030605@blackducksoftware.com
Whole thread Raw
Responses Re: is 8.4 array_agg() supposed to work with array values?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Hi,

The docs at http://developer.postgresql.org/pgdocs/postgres/functions-aggregate.html
don't prohibit using array values with array_arg(), so I assumed that it would work.
However, with CVS HEAD from Friday afternoon, I get

test=> select version() ;                                                       version
----------------------------------------------------------------------------------------------------------------------
PostgreSQL8.4devel on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20070502 (Red Hat 4.1.2-12), 64-bit
 
(1 row)

test=> select v.a, pg_typeof(v.a) from (values (array[1,2]), (array[3,4])) as v(a) ;   a   | pg_typeof
-------+----------- {1,2} | integer[] {3,4} | integer[]
(2 rows)

test=> select array_agg(v.a) from (values (array[1,2]), (array[3,4])) as v(a) ;
ERROR:  could not find array type for data type integer[]
test=>

If this is expected behavior, the docs should mention the restriction.

-- todd


pgsql-hackers by date:

Previous
From: Bernd Helmle
Date:
Subject: Re: WIP: Automatic view update rules
Next
From: "Brendan Jurd"
Date:
Subject: Re: Meridiem markers (was: [BUGS] Incorrect "invalid AM/PM string" error from to_timestamp)