Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8Kyz-003YWn-AM for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Nov 2024 14:56:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t8Kyw-00EX3Y-C5 for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Nov 2024 14:56:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8Kyw-00EX3Q-3o for pgsql-bugs@lists.postgresql.org; Tue, 05 Nov 2024 14:56:34 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8Kyq-000Jlp-1v for pgsql-bugs@lists.postgresql.org; Tue, 05 Nov 2024 14:56:33 +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 4A5EuM6w3048697; Tue, 5 Nov 2024 09:56:22 -0500 From: Tom Lane To: Rafia Sabih cc: jhecht@cirilgroup.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18689: psql : operator "!=" do not behave like "<>" In-reply-to: References: <18689-7af3dd324b42205d@postgresql.org> Comments: In-reply-to Rafia Sabih message dated "Tue, 05 Nov 2024 14:02:36 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3048695.1730818582.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 05 Nov 2024 09:56:22 -0500 Message-ID: <3048696.1730818582@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Rafia Sabih writes: > Thank you for reporting this. However I found that the lack of space in = the > statement is causing this. > On trying it like select -1 !=3D -1; it works fine. Right, see https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX= -OPERATORS particularly the bit about "A multiple-character operator name cannot end in + or -, unless ...". "!=3D-" will be treated as one operator, but "<>-" will not. regards, tom lane