Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAMuF-002JYF-1j for pgsql-general@arkaria.postgresql.org; Wed, 08 Apr 2026 07:00:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAMuE-005cFL-0M for pgsql-general@arkaria.postgresql.org; Wed, 08 Apr 2026 07:00:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAMr0-005WtF-10 for pgsql-general@lists.postgresql.org; Wed, 08 Apr 2026 06:57:34 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAMqy-00000001B0t-20wF for pgsql-general@lists.postgresql.org; Wed, 08 Apr 2026 06:57:33 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-66dd0531d01so8928627a12.3 for ; Tue, 07 Apr 2026 23:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dreamsolution.nl; s=google; t=1775631450; x=1776236250; darn=lists.postgresql.org; h=content-transfer-encoding:organization:subject:from:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=OjwyTgVNoaDjMRBAcjnRlDQRCr1OlVvWCF/E/9Q7Enc=; b=QI9xg09YEgJidP/pd7zWLHeU/KD8oPbW9buNEnzromiBviu28BHN1nelDKde18lwYl HFYdcFmYwS5is0Al9bOrRoLliIzJ7riKhz3AQKa1ZzyNeuZBY5iGbD9UVTASfd8ToC8w 2sPEDZUA/czlzACI6DykS/WmXG0vDbJgdCESRPP9r5CfCeNbQoYTFyv5wyw/z4ayiR30 sVW5gPtn3ZvjVfLIVFAjHgORkmudlPupGXW9cou1cfeSMQeg+SZU/gbJd/O2N0CVmOA3 AIM5ix2Wf8eGf/o4eixWYOHVI1gSn7WN4uFSmLkaIywswbsUtSnRkyK3V9mNbscE3Pzg FyHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775631450; x=1776236250; h=content-transfer-encoding:organization:subject:from:to :content-language:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OjwyTgVNoaDjMRBAcjnRlDQRCr1OlVvWCF/E/9Q7Enc=; b=mhPSdrHrF5D1HFcnJzcdaRp/dcDRsZjo4lnpe529MD8LOmvAuwvByGD7y5aqKDt3EP +OB2HFlureYnF8+iNRXZQ0hGGWeTm3dxd73iAq8qgb9sbb0yr6F8tP3D9xQ6tXt6LuFl KQMK9g/mUzeSMSIK1EeRaisPOMblIglWUOq7ZXiMKaDrcnscE6W/5gjU1dNLUjINLYsk iMOCBAVujKvFZq3MyBjjNlbzr8KW3OvyQan6sBhDeEktubCkTm+UFjaRpnpHZv8uizDh feiZLXQLQFfiP5B4+Leyty4rwAvtC2HOVSxjeaiAnbTS5GiGB0VE2MSfRyH1kagHVcy6 /AqA== X-Gm-Message-State: AOJu0Yzb0LLhTMiB/5P2rksX5N8Vf+DmaF7rQ8Hzo5WccG5yZfC2Rb/D kuukeCN1McdID9gBVvlYk+SEMtGmapKpOw0TuguQCfWJmPCneUiVEu2dKv/tfvCKW0z8SJuiPQG H1qyU X-Gm-Gg: AeBDieukfL/YHTBHDNo9ndoRlmIbqLLgB0jTOgnEYwqhqI0WBk25Ru9F5nQHteto3ph 8t7DQl6Fd1po2NkUWjbQ5ftyIN0QGoTRvdKkN1IrgaNFQlaVTSCHN5OQPMBob2hvv+taAOe39j8 BkXltOihl05z0s4DVxvY1EV3B14cQsiW/Lye7yF2e4/TrNMT2U9QT+i5FY6EB8zeBMcEXK0DzF6 GncZQqceDKzGQBzZ8eRLPvM4kluzrWJq64y/CMWh4XML28uFpYFkglLzkZljVyfKAvZM0dbAAVZ QzUHBGVXeMAnLNcroWI3ctfI+QpWVrPNt63Sx6JI7tberOm7NqUuDjWuDGD+2BrKSLRqYxbINDq 2iSU8+hv199SW0KMxnYcs0kK8mtzd5Qtwgv5XWTfwWLuTeilWqHF6+ZvQo5SUBdLEqQ9sjaXYnE iTOR0y8BSiSINT6FRfXqWK9KF+7nIbJjlbHTkO4ZHLteUtljus/QvWZ5GLLKmZv/+fOchM3KGsM k+xirvgsGHiT7OmSvbqCT1BBJHRKzSTMGgM4IGM9FHTyMngaG4CNfLrWpseyRvIfw8= X-Received: by 2002:a17:907:704:b0:b97:1009:7536 with SMTP id a640c23a62f3a-b9c676ec3a9mr1021398766b.15.1775631450071; Tue, 07 Apr 2026 23:57:30 -0700 (PDT) Received: from ?IPV6:2a02:928:19:1401:f941:a5f3:678f:d23e? ([2a02:928:19:1401:f941:a5f3:678f:d23e]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9c3cec6f38sm619894866b.31.2026.04.07.23.57.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2026 23:57:29 -0700 (PDT) Message-ID: <442cefbe-b6e9-45e9-a82f-3e057b35eb61@dreamsolution.nl> Date: Wed, 8 Apr 2026 08:57:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US, nl To: pgsql-general@lists.postgresql.org From: Rudolph Froger Subject: Min and max aggregates for UUIDs Organization: Dreamsolution BV Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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