ANSI SQL proposal: SELECT DISTINCT ON (... ORDER BY ...) and UNION DISTINCT ON (... ORDER BY ...)

Edit
ID 7307
Title ANSI SQL proposal: SELECT DISTINCT ON (... ORDER BY ...) and UNION DISTINCT ON (... ORDER BY ...)
CI (CFBot) Summary
Stats (from CFBot) Patch version: v3, Patch count: 5, First patch: +80−67, All patches: +2251−253
Tags SQL Commands
Created 2026-09-16 15:17:34
Last modified 2026-09-16 15:17:34 (1 month ago)
Latest email 2026-10-26 14:56:54 (yesterday)
Status
PG20-3 (2026-11-01 – 2026-11-30): Needs review
Target version
Authors Hannu Krosing (hannukrosing)
Reviewers Become reviewer
Committer
Links
Emails
ANSI SQL proposal: SELECT DISTINCT ON (... ORDER BY ...) and UNION DISTINCT ON (... ORDER BY ...)
First at 2026-08-01 13:08:48 by Hannu Krosing <hannuk at google.com>
Latest at 2026-10-26 14:56:54 by Manu <manuelreyesbravo at gmail.com>
Latest attachment (nocfbot-union-distinct-on-estimate-on-v3.diff.txt) at 2026-10-26 14:56:54 from Manu <manuelreyesbravo at gmail.com>
    Attachment (nocfbot-union-distinct-on-estimate-on-v3.diff.txt) at 2026-10-26 14:56:54 from Manu <manuelreyesbravo at gmail.com> (Patch: Yes)
    Attachment (v3-0001-Refactor-set-operation-group-clauses-to-decouple-.patch) at 2026-10-17 09:20:29 from Hannu Krosing <hannuk at google.com> (Patch: No)
    Attachment (v2-0001-Refactor-set-operation-group-clauses-to-decouple-fro.patch) at 2026-09-16 20:40:42 from Hannu Krosing <hannuk at google.com> (Patch: No)
    Attachment (0001-Refactor-set-operation-group-clauses-to-decouple-fro.patch) at 2026-09-16 15:15:41 from Hannu Krosing <hannuk at google.com> (Patch: No)
    Attachment (xxx000-distinct-on-clause.md) at 2026-08-01 13:08:48 from Hannu Krosing <hannuk at google.com> (Patch: No)
History
When Who What
2026-09-16 21:30:43 CFbot Patch does not need rebase anymore
2026-09-16 15:39:32 CFbot Patch needs rebase
2026-09-16 15:17:34 Hannu Krosing (hannukrosing) Attached mail thread CAMT0RQR_QqLqKdLgh3zYk7yA7oH9RJBVF+kZJ607wjJD9WKH9Q@mail.gmail.com
2026-09-16 15:17:34 Hannu Krosing (hannukrosing) Created patch record
Edit