Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLHed-00043i-1x for pgsql-docs@arkaria.postgresql.org; Tue, 30 Apr 2019 01:33:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLHeb-0001wl-Dy for pgsql-docs@arkaria.postgresql.org; Tue, 30 Apr 2019 01:33:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLHeb-0001wd-3B for pgsql-docs@lists.postgresql.org; Tue, 30 Apr 2019 01:33:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLHeY-00019z-As for pgsql-docs@lists.postgresql.org; Tue, 30 Apr 2019 01:33:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3U1XkGV019232; Mon, 29 Apr 2019 21:33:46 -0400 From: Tom Lane To: Bruce Momjian cc: t.dnil@yahoo.com, pgsql-docs@lists.postgresql.org Subject: Re: COALESCE doccumentation In-reply-to: <20190429231305.ra5z5bapif353vdx@momjian.us> References: <155639681797.1368.1856073093791885251@wrigleys.postgresql.org> <20190429231305.ra5z5bapif353vdx@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Mon, 29 Apr 2019 19:13:05 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19230.1556588026.1@sss.pgh.pa.us> Date: Mon, 29 Apr 2019 21:33:46 -0400 Message-ID: <19231.1556588026@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian writes: > On Sat, Apr 27, 2019 at 08:26:57PM +0000, PG Doc comments form wrote: >> Try, for example. >> >> SELECT COALESCE(NULL, '12', 3, 1, 1); -- OK! >> SELECT COALESCE(NULL, '12.2', 3.2, '1', 1.1); -- OK! >> SELECT COALESCE(NULL, '1d2', 3, 1, 1); -- error >> SELECT COALESCE(NULL, '12', 3, '1d', 1); -- cast error > What is wrong about the existing description? That it doesn't mention > mixing data types? The place where that behavior is described is https://www.postgresql.org/docs/current/typeconv-union-case.html It doesn't mention COALESCE explicitly, though ... and I imagine digging in the code for coerce_to_common_type callers might find some other cases that aren't listed there. regards, tom lane