Thread: [HACKERS] ToDo: listagg is in ANSI/SQL:2016

[HACKERS] ToDo: listagg is in ANSI/SQL:2016

From
Pavel Stehule
Date:
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