Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ev4hX-00076E-2N for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Mar 2018 17:24:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ev4hW-0002Pk-2h for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Mar 2018 17:24:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ev4hV-0002Pb-S8 for pgsql-hackers@lists.postgresql.org; Sun, 11 Mar 2018 17:24:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ev4hT-0005z9-0U for pgsql-hackers@lists.postgresql.org; Sun, 11 Mar 2018 17:24:01 +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 w2BHNtad017888; Sun, 11 Mar 2018 13:23:55 -0400 From: Tom Lane To: Dean Rasheed cc: PostgreSQL Hackers Subject: Re: Bogus use of canonicalize_qual In-reply-to: References: <24475.1520635069@sss.pgh.pa.us> <4911.1520713266@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Sun, 11 Mar 2018 09:09:22 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17886.1520789035.1@sss.pgh.pa.us> Date: Sun, 11 Mar 2018 13:23:55 -0400 Message-ID: <17887.1520789035@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dean Rasheed writes: > On 10 March 2018 at 20:21, Tom Lane wrote: >> If we suppose that we only need to fix it in HEAD, the most attractive >> answer is to add a parameter distinguishing WHERE and CHECK arguments >> to canonicalize_qual. > I agree that this looks like the best choice, but it feels a little > unsatisfactory to not back-patch a fix for such a glaring bug. You > could perhaps leave the signature of canonicalize_qual() the same, but > add a new canonicalize_check() function, and make both thin wrappers > on top of a local function accepting the is_check parameter. Hm. I'd be inclined to create canonicalize_qual_extended(qual, is_check) and then make canonicalize_qual() call that with is_check = false. But either way would avoid breaking API compatibility for the back branches. I guess the next question is whether we should do it the same way in HEAD, avoiding a cross-branch difference. But I don't like that, because part of the point here IMO is to force any external callers of canonicalize_qual() to reconsider what they're doing. regards, tom lane