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 11582.1158773506@sss.pgh.pa.us
Whole thread Raw
In response to Re: TODO: Fix CREATE CAST on DOMAINs  (Mark Dilger <pgsql@markdilger.com>)
Responses Re: TODO: Fix CREATE CAST on DOMAINs  (Mark Dilger <pgsql@markdilger.com>)
List pgsql-hackers
Mark Dilger <pgsql@markdilger.com> writes:
> Mark Dilger wrote:
>> 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.

> I have thought about this some more.  I think these are indeed SAFE.  The 
> distinction between SAFE and IMPLICIT should not, I think, be whether the 
> storage type is identical, but rather whether there is any possible loss of 
> precision, range, accuracy, etc., or whether there is any change in the 
> fundamental interpretation of the data when cast from the source to destination 
> type.

You are going in exactly the wrong direction --- this line of thought is
aiming to make *more* casts possible by default, which is not what we
need, at least not among the collection of base types.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: TODO: Fix CREATE CAST on DOMAINs
Next
From: Alvaro Herrera
Date:
Subject: Re: Release Notes: Major Changes in 8.2