Re: Add MIN/MAX aggregate support for uuid

Tristan Partin <tristan@partin.io>

From: "Tristan Partin" <tristan@partin.io>
To: "Masahiko Sawada" <sawada.mshk@gmail.com>
Cc: "pgsql-hackers" <pgsql-hackers@postgresql.org>
Date: 2026-06-24T19:13:36Z
Lists: pgsql-hackers
On Wed Jun 24, 2026 at 6:13 PM UTC, Masahiko Sawada wrote:
> On Wed, Jun 24, 2026 at 10:50 AM Tristan Partin <tristan@partin.io> wrote:
>> Attached is a v2.
>
> The patch mostly looks good to me. One minor comment is:
>
> +{ oid => '6519', proname => 'uuid_larger', proleakproof => 't',
> +  prorettype => 'uuid', proargtypes => 'uuid uuid', prosrc => 'uuid_larger' },
> +{ oid => '6520', proname => 'uuid_smaller', proleakproof => 't',
> +  prorettype => 'uuid', proargtypes => 'uuid uuid', prosrc => 'uuid_smaller' },
>
> I think we should add the 'decr' to both functions.

Any opinions on what the descriptions should be? Here are the equivalent 
functions for OID:

	{ oid => '1965', descr => 'larger of two',
	  proname => 'oidlarger', prorettype => 'oid', proargtypes => 'oid oid',
	  prosrc => 'oidlarger' },
	{ oid => '1966', descr => 'smaller of two',
	  proname => 'oidsmaller', prorettype => 'oid', proargtypes => 'oid oid',
	  prosrc => 'oidsmaller' },

-- 
Tristan Partin
PostgreSQL Contributors Team
AWS (https://aws.amazon.com)



Commits

  1. Add min() and max() aggregate support for uuid.