Min and max aggregates for UUIDs

  • Jump to comment-1
    Rudolph Froger<rudolphfroger@dreamsolution.nl>
    Apr 8, 2026, 7:00 AM UTC
    Hi,
    With the support for UUIDv7 in PostgreSQL 18 it also makes sense to support aggregates like `min` and `max` for UUIDs.
    For example for queries like these:
    SELECT bookshop_id, uuid_extract_timestamp(max(id)) AS latest_book_created FROM books GROUP BY bookshop_id;
    In the meantime I use custom aggregates but it would be great to have these builtin.
    BTW many thanks for the great UUIDv7 support and all the fantastic work on PostgreSQL!
    Cheers, Rudolph