Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iFhvX-0002yb-60 for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Oct 2019 16:56:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iFhvV-0000L9-Oo for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Oct 2019 16:56:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iFhvV-0000Kx-8N for pgsql-hackers@lists.postgresql.org; Wed, 02 Oct 2019 16:56:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iFhvS-0004Bt-RE for pgsql-hackers@lists.postgresql.org; Wed, 02 Oct 2019 16:56:32 +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 x92GuTPQ010439; Wed, 2 Oct 2019 12:56:29 -0400 From: Tom Lane To: Andrew Gierth cc: pgsql-hackers@lists.postgresql.org Subject: Re: Possible bug: SQL function parameter in window frame definition In-reply-to: <87y2y314qm.fsf@news-spur.riddles.org.uk> References: <87tv8wmn1i.fsf@news-spur.riddles.org.uk> <32758.1569703063@sss.pgh.pa.us> <87mueom8km.fsf@news-spur.riddles.org.uk> <26051.1569712242@sss.pgh.pa.us> <87impbn2d4.fsf@news-spur.riddles.org.uk> <87eezzmls2.fsf@news-spur.riddles.org.uk> <28299.1569780931@sss.pgh.pa.us> <877e5n2n70.fsf@news-spur.riddles.org.uk> <6666.1570030371@sss.pgh.pa.us> <8736gb2kct.fsf@news-spur.riddles.org.uk> <9394.1570033875@sss.pgh.pa.us> <87y2y314qm.fsf@news-spur.riddles.org.uk> Comments: In-reply-to Andrew Gierth message dated "Wed, 02 Oct 2019 17:50:13 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10437.1570035389.1@sss.pgh.pa.us> Date: Wed, 02 Oct 2019 12:56:29 -0400 Message-ID: <10438.1570035389@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andrew Gierth writes: > OK. So here's the final patch. > (For the benefit of anyone in -hackers not following the original thread > in -general, the problem here is that expressions in window framing > clauses were not being walked or mutated by query_tree_walker / > query_tree_mutator. This has been wrong ever since 9.0, but somehow > nobody seems to have noticed until now.) Two nitpicky suggestions: * Please run it through pgindent. Otherwise v13+ are going to be randomly different from older branches in this area, once we next pgindent HEAD. * I think you missed s/walk/mutate/ in some of the comments you copied into query_tree_mutator. Looks good otherwise. regards, tom lane