Re: Proposal: QUALIFY clause

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: Proposal: QUALIFY clause
Date: 2025-07-21 20:23:32
Message-ID: a042f530-90a4-46fc-8595-43053fcfc06e@postgresfriends.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 21/07/2025 14:47, Matheus Alcantara wrote:
> Hi all,
>
> I'm sending a proof-of-concept patch to add support for the QUALIFY
> clause in Postgres. This feature allows filtering rows after window
> functions are computed, using a syntax similar to the WHERE or HAVING
> clauses.

I took a very brief look at this, and I think your grammar is wrong. 
The QUALIFY clause should go after the WINDOW clause, just like
FROM/WHERE and GROUP BY/HAVING.

That is what I am proposing to the standards committee, and I already
have some buy-in for that.

--

Vik Fearing

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2025-07-21 20:26:51 Re: Proposal: QUALIFY clause
Previous Message Nathan Bossart 2025-07-21 20:20:55 Re: Verify predefined LWLocks tranches have entries in wait_event_names.txt