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 1pVxos-0000fu-BA for pgsql-general@arkaria.postgresql.org; Sat, 25 Feb 2023 16:54:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pVxoq-0007UR-Rr for pgsql-general@arkaria.postgresql.org; Sat, 25 Feb 2023 16:54:44 +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 1pVxoq-0007UI-HB for pgsql-general@lists.postgresql.org; Sat, 25 Feb 2023 16:54:44 +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 1pVxok-0007mb-1S for pgsql-general@postgresql.org; Sat, 25 Feb 2023 16:54:43 +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 31PGsZqQ1179564; Sat, 25 Feb 2023 11:54:35 -0500 From: Tom Lane To: david wheeler cc: pgsql-general@postgresql.org Subject: Re: IS as a binary operator In-reply-to: <4996BD98-0349-4871-B952-AFD8261920D0@gmail.com> References: <4996BD98-0349-4871-B952-AFD8261920D0@gmail.com> Comments: In-reply-to david wheeler message dated "Sat, 25 Feb 2023 21:38:38 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1179562.1677344075.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 25 Feb 2023 11:54:35 -0500 Message-ID: <1179563.1677344075@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk david wheeler writes: > I guess there=E2=80=99s no interest in adding support for `IS` as basica= lly an alias for `IS NOT DISTINCT FROM`? (and `IS NOT` for `IS DISTINCT FR= OM`) Seems like it'd be impossibly ambiguous with the various sorts of "x IS FOO" constructs that SQL keeps adding. We'd have to make all the FOO keywords fully reserved, which would break people's queries for sure. (Things like CONTENT, DOCUMENT, NORMALIZED, and NFC are unreserved at the moment; and at least the first two of those are pretty plausible as user column names.) Another problem is that currently IS is a type_func_name_keyword, which makes things like this syntactically valid: regression=3D# select is(42); ERROR: function is(integer) does not exist I doubt we could preserve that in the face of what you suggest. Maybe no one would care, but ... On the whole, I'm afraid of what sorts of "IS" constructs might come out of the committee in future, and what sort of hard place we might find ourselves in if we allow "IS" to not be followed by one of a small set of known keyword sequences. It is a shame that there's nothing less verbose than "IS NOT DISTINCT FROM" for what is surely a pretty common requirement. But we probably need to get the SQL committee on board with any replacement syntax for that. regards, tom lane