Hi, > Exactly Tom, I see no fundamental problem for it not to be implemented, since > comparison operator is already implemented. In fact, MIN/MAX should work for > all types for which comparison operator is defined.
On second thought, this should work reasonably well. PFA a WIP patch. At this point it implements only MAX(record), no MIN, no tests: ``` =# SELECT MAX(row(year, month)) FROM (VALUES(2025, 1), (2024,2)) x(year, month); max ---------- (2025,1) ``` One thing I'm not 100% sure of is whether record_larger() should make a copy of its arguments or the current implementation is safe. -- Best regards, Aleksander Alekseev
v1-0001-Support-MIN-MAX-record-aggregates-WIP.patch
Description: Binary data