Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOmaM-0003YN-GG for pgsql-sql@arkaria.postgresql.org; Tue, 12 Dec 2017 15:35:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOmaM-000198-2p for pgsql-sql@arkaria.postgresql.org; Tue, 12 Dec 2017 15:35:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eOmaL-00016u-QP for pgsql-sql@lists.postgresql.org; Tue, 12 Dec 2017 15:35:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eOmaJ-00051w-FZ for pgsql-sql@lists.postgresql.org; Tue, 12 Dec 2017 15:35:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vBCFZ5N9032702; Tue, 12 Dec 2017 10:35:05 -0500 From: Tom Lane To: =?UTF-8?B?0JDQvdC00YDQtdC5INCW0LjQtNC10L3QutC+0LI=?= cc: pgsql-sql@lists.postgresql.org Subject: Re: FILTER clause for non-aggregate window functions In-reply-to: References: Comments: In-reply-to =?UTF-8?B?0JDQvdC00YDQtdC5INCW0LjQtNC10L3QutC+0LI=?= message dated "Tue, 12 Dec 2017 10:54:14 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32700.1513092905.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 12 Dec 2017 10:35:05 -0500 Message-ID: <32701.1513092905@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?UTF-8?B?0JDQvdC00YDQtdC5INCW0LjQtNC10L3QutC+0LI=3D?=3D writes: > Why FILTER is not implemented for non-aggregate functions? The SQL standard only describes FILTER for aggregates. I'm not sure offhand whether it'd be semantically sensible for window functions. In any case, seems like most of the cases where you'd want it can be expressed equally well by putting the restriction into WHERE. regards, tom lane