Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1udx2w-002oNV-4a for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jul 2025 20:23:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1udx2v-002mro-7U for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jul 2025 20:23:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1udx2u-002mrg-Uh for pgsql-hackers@lists.postgresql.org; Mon, 21 Jul 2025 20:23:37 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1udx2s-0006Bc-02 for pgsql-hackers@postgresql.org; Mon, 21 Jul 2025 20:23:36 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 3E50B44386; Mon, 21 Jul 2025 20:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postgresfriends.org; s=gm1; t=1753129413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=niw7FSTjOfmqEdshL9FMSfBlzBQQW2d9zeSCtDUYrhA=; b=ORRLfzKmz63CPUCEy55M9TzGREb61guUJ5f5Hkp2twxd8uMdl4TQjIWikb8ZtzQrNQTvXG AZCGhTgVx6Lb+aJzRXjFo4Q7U6IBM8cHdF+maJpfFKtxI6a88UTxu0KvgvOFsL1OEhOTrP EqIdi6qqW8fsRIL1N2xt765xrrLBU+eqT1/UJn3/w4f3VWLkhMRtA9k8CIy7loxUoV7szv wQMLxHZVngi81ZpEzaxAaH18ilqWzdK85pan5WBHAegDitedlxh+VpnkZJ1qz2Xkfw1t+x Y2LeKOVGuI/4Imxmqoc/3C5OS87xpRkCm56X2ycMoHE4UqPr7MPxBP74c4Cm0w== Message-ID: Date: Mon, 21 Jul 2025 22:23:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Proposal: QUALIFY clause To: Matheus Alcantara , Pg Hackers Cc: Peter Eisentraut References: Content-Language: en-US From: Vik Fearing In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdejfedtvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeggihhkucfhvggrrhhinhhguceovhhikhesphhoshhtghhrvghsfhhrihgvnhgushdrohhrgheqnecuggftrfgrthhtvghrnhepuddtveefleegvddutdejhffhleehhfevheeilefhgeettdeuhfdtffegvdfgteffnecukfhppedvrgdtvdemkeegvdekmeduudgvtdemvdejtddumegrgegvudemgedvfhegmegrlegrkeemkegvieeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemudduvgdtmedvjedtudemrgegvgdumeegvdhfgeemrgelrgekmeekvgeikedphhgvlhhopeglkffrggeimedvrgdtvdemkeegvdekmeduudgvtdemvdejtddumegrgegvudemgedvfhegmegrlegrkeemkegvieekngdpmhgrihhlfhhrohhmpehvihhksehpohhsthhgrhgvshhfrhhivghnughsrdhorhhgpdhnsggprhgtphhtthhopeefpdhrtghpthhtohepmhgrthhhvghushhsshhilhhvleejsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhgp dhrtghpthhtohepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhg X-GND-Sasl: vik@postgresfriends.org List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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