
This module provides ARRAY_AGG() and UNNEST() for
PostgreSQL 8.3.

These functions already exist in PostgreSQL 8.4 and above, so this
module is not necessary for versions after PostgreSQL 8.3.

ARRAY_AGG is an aggregate that takes ANYELEMENT, and returns an array
consisting of all of the input values, including any NULLs.

UNNEST is a set-returning function that takes ANYARRAY, and returns a
set of the elements in the array.

Examples:

=> select array_agg(column1) from (values (1),(2),(3)) c;
 array_agg 
-----------
 {1,2,3}
(1 row)

=> select array_agg(column1) from (values (1),(2),(3)) c where false;
 array_agg 
-----------
 
(1 row)

=> select array_agg(column1) from (values (1),(2),(NULL)) c;
 array_agg  
------------
 {1,2,NULL}
(1 row)

=> select array_agg(column1) from (values (NULL)) c;
 array_agg 
-----------
 {NULL}
(1 row)

=> select unnest(ARRAY[1,NULL,2,3]);
 unnest 
--------
      1
       
      2
      3
(4 rows)



