Re: TODO: Fix CREATE CAST on DOMAINs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Dilger <pgsql(at)markdilger(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO: Fix CREATE CAST on DOMAINs
Date: 2006-09-20 20:08:53
Message-ID: 18184.1158782933@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mark Dilger <pgsql(at)markdilger(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2006-09-20 20:13:04 Re: Phantom Command ID
Previous Message Tom Lane 2006-09-20 20:02:00 Re: Phantom Command ID