Re: Function array_agg(array)

From: Ali Akbar <the(dot)apaan(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Function array_agg(array)
Date: 2014-10-19 06:02:55
Message-ID: CACQjQLrPfFYn352v4A2Ho=D=RYtCX5x1SSbz3cpJrxOra6Gs5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> So, is there any idea how we will handle NULL and empty array in
> array_agg(anyarray)?
> I propose we just reject those input because the output will make no sense:
> - array_agg(NULL::int[]) --> the result will be indistinguished from
> array_agg of NULL ints.
> - array_agg('{}'::int[]) --> how we determine the dimension of the result?
> is it 0? Or the result will be just an empty array {} ?
>

This updated patch rejects NULL and {} arrays as noted above.

Regards,
--
Ali Akbar

Attachment Content-Type Size
array_agg_anyarray-3.patch text/x-patch 12.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2014-10-19 07:54:27 Re: Superuser connect during smart shutdown
Previous Message Jim Nasby 2014-10-19 02:36:48 Re: Autovacuum fails to keep visibility map up-to-date in mostly-insert-only-tables