# sqlalchemy 2.1.9 (MIT), harvested by tools/harvest_corpus.py
=== input
Represent a PostgreSQL aggregate order by expression.

    E.g.::

        from sqlalchemy.dialects.postgresql import aggregate_order_by

        expr = func.array_agg(aggregate_order_by(table.c.a, table.c.b.desc()))
        stmt = select(expr)

    would represent the expression:

    .. sourcecode:: sql

        SELECT array_agg(a ORDER BY b DESC) FROM table;

    .. legacy:: An improved dialect-agnostic form of this function is now
       available in Core by calling the
       :meth:`_functions.Function.aggregate_order_by` method on any function
       defined by the backend as an aggregate function.

    .. seealso::

        :func:`_sql.aggregate_order_by` - Core level function

        :class:`_functions.array_agg`

    
=== parse rest
short_description: 'Represent a PostgreSQL aggregate order by expression.'
long_description: |
  E.g.::
  
      from sqlalchemy.dialects.postgresql import aggregate_order_by
  
      expr = func.array_agg(aggregate_order_by(table.c.a, table.c.b.desc()))
      stmt = select(expr)
  
  would represent the expression:
  
  .. sourcecode:: sql
  
      SELECT array_agg(a ORDER BY b DESC) FROM table;
  
  .. legacy:: An improved dialect-agnostic form of this function is now
     available in Core by calling the
     :meth:`_functions.Function.aggregate_order_by` method on any function
     defined by the backend as an aggregate function.
  
  .. seealso::
  
      :func:`_sql.aggregate_order_by` - Core level function
  
      :class:`_functions.array_agg`
blank_after_short_description: True
blank_after_long_description: False
style: rest
=== detect
rest
=== compose rest
Represent a PostgreSQL aggregate order by expression.

E.g.::

    from sqlalchemy.dialects.postgresql import aggregate_order_by

    expr = func.array_agg(aggregate_order_by(table.c.a, table.c.b.desc()))
    stmt = select(expr)

would represent the expression:

.. sourcecode:: sql

    SELECT array_agg(a ORDER BY b DESC) FROM table;

.. legacy:: An improved dialect-agnostic form of this function is now
   available in Core by calling the
   :meth:`_functions.Function.aggregate_order_by` method on any function
   defined by the backend as an aggregate function.

.. seealso::

    :func:`_sql.aggregate_order_by` - Core level function

    :class:`_functions.array_agg`
