Re: Inaccurate description of UNION/CASE/etc type selection - Mailing list pgsql-docs

From David G. Johnston
Subject Re: Inaccurate description of UNION/CASE/etc type selection
Date
Msg-id CAKFQuwY_TRhxKvnf26L0ZQpYm56Y7__WL7GhR0VGg8AX90HTJw@mail.gmail.com
Whole thread Raw
In response to Re: Inaccurate description of UNION/CASE/etc type selection  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Inaccurate description of UNION/CASE/etc type selection  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-docs
On Sun, Aug 16, 2020 at 5:58 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
5. If the first non-unknown type is a preferred type it is chosen, otherwise it is made a candidate, and then,
6. each subsequent type is compared to the current candidate, with a new candidate being chosen only when there exists a non-mutal implicit cast to the new type.
6a. If at any point a preferred type is made a candidate then it will be chosen.

More concisely:

Make the first input type a candidate type.  Each subsequent input type is compared to the current candidate, with a new candidate being chosen only when there exists a non-mutal implicit cast to the new type.  If at any point a preferred type is made a candidate then it will be chosen.

In my original the whole if/otherwise in 5 is pointless given the presence of 6a.

David J.

pgsql-docs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Inaccurate description of UNION/CASE/etc type selection
Next
From: Tom Lane
Date:
Subject: Re: Inaccurate description of UNION/CASE/etc type selection