Re: ANSI SQL proposal: SELECT DISTINCT ON (... ORDER BY ...) and UNION DISTINCT ON (... ORDER BY ...) - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: ANSI SQL proposal: SELECT DISTINCT ON (... ORDER BY ...) and UNION DISTINCT ON (... ORDER BY ...)
Date
Msg-id CAMT0RQRL7cqpKHMsRd0cCjDQMRHonv3aW5Pj5NH3G=52MfYVew@mail.gmail.com
Whole thread
Responses Re: ANSI SQL proposal: SELECT DISTINCT ON (... ORDER BY ...) and UNION DISTINCT ON (... ORDER BY ...)
List pgsql-hackers
Here is a patch set implementing this



On Sat, Aug 1, 2026 at 3:08 PM Hannu Krosing <hannuk@google.com> wrote:
Hi Vik

Finally had time to put this SQL Standard Propoasl together.

Please take a quick look and tell me what is missing or wrong and what
the next steps should be.

For example, should I mention somewhere that PostgreSQL supports a
partial version of the SELECT DISTINCT ON () ?

Regarding PGQ in PostgreSQL, this should allow a plain SQL target for
arbitrary length graph queries and at least some types of path finding
queries.

I hope to have some working PoC code for PostgreSQL within the next
few days so I can share actual working versions of both sample
recursive graph queries and the "overlay of read-only table" queries I
talked to you about.

-----
Hannu
Attachment

pgsql-hackers by date:

Previous
From: Atsushi Ogawa
Date:
Subject: Re: [PATCH] Use Boyer-Moore-Horspool for simple LIKE contains patterns
Next
From: Sami Imseih
Date:
Subject: Re: Track skipped tables during autovacuum and autoanalyze