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 1ldyIf-00050L-K2 for pgsql-bugs@arkaria.postgresql.org; Tue, 04 May 2021 16:53:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ldyIe-0002x1-Fp for pgsql-bugs@arkaria.postgresql.org; Tue, 04 May 2021 16:53:32 +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 1ldyIe-0002wt-9k for pgsql-bugs@lists.postgresql.org; Tue, 04 May 2021 16:53:32 +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 1ldyIb-0007eA-5n for pgsql-bugs@lists.postgresql.org; Tue, 04 May 2021 16:53:31 +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 144GrROc3911710; Tue, 4 May 2021 12:53:27 -0400 From: Tom Lane To: Manvendra cc: pgsql-bugs@lists.postgresql.org Subject: Re: NULL handling in 1D array comparison In-reply-to: References: Comments: In-reply-to Manvendra message dated "Tue, 04 May 2021 22:05:06 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3911708.1620147207.1@sss.pgh.pa.us> Date: Tue, 04 May 2021 12:53:27 -0400 Message-ID: <3911709.1620147207@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Manvendra writes: > Comparison should return UNKNOWN but it's returning a true. > postgres=# select array[null]=array[null]; Yeah, that's intentional, because we have to be able to sort arrays. Comparison of composites behaves similarly, btw. > SQL-99 standard use to say it should come out as UNKNOWN We're going to politely ignore the spec on this. regards, tom lane