Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6gV2-0005Co-2e for pgsql-general@arkaria.postgresql.org; Fri, 14 Aug 2020 20:40:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k6gUy-0005Wi-IZ for pgsql-general@arkaria.postgresql.org; Fri, 14 Aug 2020 20:40:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6gUy-0005Wb-5K for pgsql-general@lists.postgresql.org; Fri, 14 Aug 2020 20:40:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6gUv-0005z7-WA for pgsql-general@postgresql.org; Fri, 14 Aug 2020 20:40:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 07EKeJOK658399; Fri, 14 Aug 2020 16:40:20 -0400 From: Tom Lane To: PegoraroF10 cc: pgsql-general@postgresql.org Subject: Re: Server goes to Recovery Mode when run a SQL In-reply-to: <1597431363603-0.post@n3.nabble.com> References: <1549211574297-0.post@n3.nabble.com> <20190204010709.GC1881@paquier.xyz> <1597265258319-0.post@n3.nabble.com> <323345.1597270142@sss.pgh.pa.us> <1597410304614-0.post@n3.nabble.com> <572934.1597413823@sss.pgh.pa.us> <1597422849057-0.post@n3.nabble.com> <650987.1597427089@sss.pgh.pa.us> <1597430001991-0.post@n3.nabble.com> <1597431363603-0.post@n3.nabble.com> Comments: In-reply-to PegoraroF10 message dated "Fri, 14 Aug 2020 11:56:03 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <658397.1597437619.1@sss.pgh.pa.us> Date: Fri, 14 Aug 2020 16:40:19 -0400 Message-ID: <658398.1597437619@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PegoraroF10 writes: > CREATE FUNCTION public.fntextonumero(finteger public.i32, ftext text) > RETURNS boolean > LANGUAGE sql STABLE > AS $$ > SELECT ftext = finteger::text; > $$; Huh. The crash goes away if you change that to SELECT finteger::text = ftext; It looks like ExecInitSubPlan is just assuming that the outer side of the hashable comparison condition is on the left, and this function is confusing it by swapping that around to the right. Kinda surprising that we never identified that problem before --- this code's been like this for years. regards, tom lane