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 1lAaHu-0008Or-Sr for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Feb 2021 15:23:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lAaHt-00037N-M0 for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Feb 2021 15:23:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAaHt-00036n-Ff for pgsql-bugs@lists.postgresql.org; Fri, 12 Feb 2021 15:23:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAaHr-0006lB-1C for pgsql-bugs@lists.postgresql.org; Fri, 12 Feb 2021 15:23:17 +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 11CFNCGe1552248; Fri, 12 Feb 2021 10:23:12 -0500 From: Tom Lane To: firstdismay@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16862: Unexpected result of checking for null "IS NOT NULL" in function In-reply-to: <16862-c10a7401d2973a9b@postgresql.org> References: <16862-c10a7401d2973a9b@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Fri, 12 Feb 2021 02:45:36 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1552246.1613143392.1@sss.pgh.pa.us> Date: Fri, 12 Feb 2021 10:23:12 -0500 Message-ID: <1552247.1613143392@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > 1. Create TABLE: "bpd"."group" AND view > 2. Create FUNCTION: > DECLARE: egroupV "bpd"."vgroup"%ROWTYPE; view > DECLARE: egroupT "bpd"."group"%ROWTYPE; table > 3. Retrieving data checking the result in function: > SELECT * INTO egroupV FROM "bpd"."vgroup" WHERE id = iid; > SELECT * INTO egroupT FROM "bpd"."group" WHERE id = iid; > IF (egroupV IS NOT NULL) THEN => state OK > IF (egroupT IS NOT NULL) THEN => state OK > IF NOT(egroupV IS NULL) THEN => state OK > IF NOT(egroupT IS NULL) THEN => state OK > 4. ALTER TABLE "bpd"."group" ADD COLUMN > 5. Retrieving data checking the result in function: > SELECT * INTO egroup FROM "bpd"."vgroup" WHERE id = iid; > SELECT * INTO egroupT FROM "bpd"."group" WHERE id = iid; > IF (egroupV IS NOT NULL) THEN => state OK > IF (egroupT IS NOT NULL) THEN => state NOT WORK??????????? > IF NOT(egroupV IS NULL) THEN => state OK > IF NOT(egroupT IS NULL) THEN => state OK It's impossible to make any sense of this report. What do you think "not work" means? You have not provided enough detail to let someone else reproduce whatever you're seeing, either. Please read https://wiki.postgresql.org/wiki/Guide_to_reporting_problems regards, tom lane