ToDo: listagg is in ANSI/SQL:2016

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: ToDo: listagg is in ANSI/SQL:2016
Date: 2017-03-14 05:16:25
Message-ID: CAFj8pRD=BR0JM8NFVpFsaY3ztvEupwhSKgDkHLCRLjpCMM1RAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

looks like Oracle has pretty strong position in standard. ANSI SQL has new
aggregate function listagg. It is supported by DB2 too.

Unfortunately one supported syntax is not possible in Postgres due our
design of ordered aggregates.

Syntax:

1. listagg(expr) FROM ... not deterministic result
2. listagg(expr, separator) FROM ... previous with separator - when sep. is
NULL, then it is ignored

3. listagg(expr [, sep]) WITHIN GROUP (ORDER BY expr_list)

last syntax is not available in Postgres - because our ordered aggregates
expects immutable arguments in ordered aggregates arguments. First two are
not supported two, because ORDER BY clause is required every time.

Regards

Pavel

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2017-03-14 05:37:24 Re: Performance improvement for joins where outer side is unique
Previous Message Ashutosh Sharma 2017-03-14 04:34:39 Re: PATCH: pageinspect / add page_checksum and bt_page_items(bytea)