Skip to content

ORDER BY support in aggregate functions #1334

@fulghum

Description

@fulghum

Postgres aggregate functions (e.g. string_agg()) can take an optional ORDER BY clause as the last argument. Doltgres doesn't support this syntax yet.

Example query:

SELECT type.typname AS name, type.OID AS oid, n.nspname AS schema, string_agg(enum.enumlabel, ',' ORDER BY enum.enumsortorder) AS value
FROM pg_enum AS enum
JOIN pg_type AS type ON (type.oid = enum.enumtypid)
JOIN pg_namespace n ON type.typnamespace = n.oid
WHERE n.nspname = ANY (current_schemas(false))
GROUP BY type.OID, n.nspname, type.typname;

Found while testing a simple Rails app with Doltgres.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions