Re: TODO: Fix CREATE CAST on DOMAINs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: TODO: Fix CREATE CAST on DOMAINs
Date
Msg-id 18184.1158782933@sss.pgh.pa.us
Whole thread Raw
In response to Re: TODO: Fix CREATE CAST on DOMAINs  (Mark Dilger <pgsql@markdilger.com>)
List pgsql-hackers
Mark Dilger <pgsql@markdilger.com> writes:
> If the system chooses cast chains based on a breadth-first search,
> then the existing int2 -> int8 cast would be chosen over an int2 ->
> int4 -> int8 chain, or an int2 -> int3 -> int4 -> int8 chain, or in
> fact any chain at all, because the int2 -> int8 cast is the shortest.

Well, this is the sort of thing that has to be thought about pretty
carefully.  Is "length of chain" the most appropriate metric?  What are
you going to do when resolving a multi-input operator or function, and
there are different ways to match different candidates with different
sets of path lengths?

There's been some prior discussion of attaching a "measure of goodness"
to different potential cast pathways.  I'm too lazy to look it up at the
moment but I strongly suggest whoever wants to produce a concrete
proposal in this area should go check the archives.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Phantom Command ID
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Phantom Command ID