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 1kcvqw-0003dC-Gk for pgsql-docs@arkaria.postgresql.org; Wed, 11 Nov 2020 19:32:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kcvqu-0002Uw-Id for pgsql-docs@arkaria.postgresql.org; Wed, 11 Nov 2020 19:32:20 +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 1kcvqu-0002Uo-D4 for pgsql-docs@lists.postgresql.org; Wed, 11 Nov 2020 19:32:20 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcvqp-00066d-Ox for pgsql-docs@lists.postgresql.org; Wed, 11 Nov 2020 19:32:19 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kcvqn-0004Gv-TZ; Wed, 11 Nov 2020 14:32:13 -0500 Date: Wed, 11 Nov 2020 14:32:13 -0500 From: Bruce Momjian To: Tom Lane Cc: vadym.feskin@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: Addition to content Message-ID: <20201111193213.GA25840@momjian.us> References: <160486028730.25500.15740897403028593550@wrigleys.postgresql.org> <1984017.1604938199@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1984017.1604938199@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Nov 9, 2020 at 11:09:59AM -0500, Tom Lane wrote: > PG Doc comments form writes: > > I would be helpful to add that NULLIF and COALESCE need to be of same data > > type. > > That's not actually a correct statement ... which I guess just reinforces > your point that the behavior needs to be documented. FYI, this was done in this commit: commit 24b83a5082 Author: Tom Lane Date: Mon Nov 9 12:02:24 2020 -0500 Doc: clarify data type behavior of COALESCE and NULLIF. After studying the code, NULLIF is a lot more subtle than you might have guessed. Discussion: https://postgr.es/m/160486028730.25500.15740897403028593550@wrigleys.postgresql.org -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee