Re: COALESCE doccumentation

Tom Lane <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.documentation
Message-ID <[email protected]>
Bruce Momjian <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.