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

From Martijn van Oosterhout
Subject Re: TODO: Fix CREATE CAST on DOMAINs
Date
Msg-id 20060920201410.GF7888@svana.org
Whole thread Raw
In response to Re: TODO: Fix CREATE CAST on DOMAINs  (Mark Dilger <pgsql@markdilger.com>)
List pgsql-hackers
On Wed, Sep 20, 2006 at 09:31:48AM -0700, Mark Dilger wrote:
> Perhaps we need to be able to register casts with more information than
> just IMPLICIT vs. EXPLICIT.  Perhaps we also need something like SAFE or
> some other term, and then have a rule that no chain of casts chosen by the
> system (as opposed to specified by the user) can contain more than one
> IMPLICIT cast, but can contain unlimited many SAFE casts.

Currently cast have three types, implicit, explicit and assignment.

You don't want to have an unlimited number of anything. Cast lookups
are expensive enough as it is.

> Casts from int2 -> int4, int2 -> int8, and int4 -> int8 would all be SAFE,
> I think, because they are not lossy.  But perhaps I have not thought enough
> about this and these should be IMPLICIT rather than SAFE.

Yeah, but the trick is you want, with the above casts to only ever
produce the *shortest* path. That's what makes it expensive.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Phantom Command ID
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Release notes