From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: t.dnil@yahoo.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: COALESCE doccumentation
Date: Mon, 29 Apr 2019 21:33:46 -0400
Message-ID: <19231.1556588026@sss.pgh.pa.us> (raw)
In-Reply-To: <20190429231305.ra5z5bapif353vdx@momjian.us>
References: <155639681797.1368.1856073093791885251@wrigleys.postgresql.org>
<20190429231305.ra5z5bapif353vdx@momjian.us>
Bruce Momjian <bruce@momjian.us> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, t.dnil@yahoo.com, pgsql-docs@lists.postgresql.org
Subject: Re: COALESCE doccumentation
In-Reply-To: <19231.1556588026@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox