Skip to content

Support for postgresql aggregate options #7475

Description

@CaselIT

Describe the use case

Postgresql supports many options for aggregate functions, like distinct, filter, etc. Documentation at https://www.postgresql.org/docs/current/sql-expressions.html#SYNTAX-AGGREGATES

There is currently support for

A possible api may be to replace aggregate_order_by with an aggregate_options that accepts also other functionality.

Databases / Backends / Drivers targeted

postgresql

Example Use

select array_agg(distinct v order by v desc) FILTER (WHERE v < 3)
from (
  select v
  from generate_series(1, 3) v
  union all
  select v
  from generate_series(2, 5) v
) as v

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    postgresqlsqluse casenot really a feature or a bug; can be support for new DB features or user use cases not anticipated

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions