Re: COALESCE doccumentation - Mailing list pgsql-docs

From Tom Lane
Subject Re: COALESCE doccumentation
Date
Msg-id 19231.1556588026@sss.pgh.pa.us
Whole thread Raw
In response to Re: COALESCE doccumentation  (Bruce Momjian <bruce@momjian.us>)
List pgsql-docs
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



pgsql-docs by date:

Previous
From: Daniil Treshchin
Date:
Subject: Re: COALESCE doccumentation
Next
From: Daniil Treshchin
Date:
Subject: Re: COALESCE doccumentation