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 1i8dD4-0000J2-3e for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Sep 2019 04:29:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i8dD2-0002XU-U4 for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Sep 2019 04:29:24 +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 1i8dD2-0002XL-Je for pgsql-bugs@lists.postgresql.org; Fri, 13 Sep 2019 04:29:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i8dD0-0004RU-8x for pgsql-bugs@lists.postgresql.org; Fri, 13 Sep 2019 04:29:23 +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 x8D4TH1j023379; Fri, 13 Sep 2019 00:29:17 -0400 From: Tom Lane To: Vinay Banakar cc: Andres Freund , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16006: Update queries fail on a table having any policy with a function that takes a whole-row var as arg In-reply-to: References: <16006-99290d2e4642cbd5@postgresql.org> <28076.1568320435@sss.pgh.pa.us> <20190912211047.kr7e4pn7iof76jfx@alap3.anarazel.de> <1141.1568327305@sss.pgh.pa.us> Comments: In-reply-to Vinay Banakar message dated "Fri, 13 Sep 2019 09:43:21 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23377.1568348957.1@sss.pgh.pa.us> Date: Fri, 13 Sep 2019 00:29:17 -0400 Message-ID: <23378.1568348957@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Vinay Banakar writes: > Thank you for finding the root cause, I just checked on 9.15.17 and it is > still failing here also. > But I distinctly remember it working earlier, not sure which version of pg > (at least <9.5.16) though as I have lost that earlier setup. Oh! I misread your report as being that it worked on 9.5.x and failed on 9.6.x. If it really did work on some earlier 9.5.x version, then we must've busted it with a patch ... but what? That bizarre code in ExecEvalWholeRowVar is much older than 9.5 (looks like it dates to 8e617e29a), and the mistake proper goes back to the introduction of WITH CHECK OPTION in 9.4 (4cbe3ac3e). I'm not seeing any other moving parts here. regards, tom lane