Re: CREATE CAST allows creation of binary-coercible cast to range over domain - Mailing list pgsql-bugs

From Tom Lane
Subject Re: CREATE CAST allows creation of binary-coercible cast to range over domain
Date
Msg-id 1537781.1724165175@sss.pgh.pa.us
Whole thread Raw
In response to CREATE CAST allows creation of binary-coercible cast to range over domain  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: CREATE CAST allows creation of binary-coercible cast to range over domain
List pgsql-bugs
Peter Eisentraut <peter@eisentraut.org> writes:
> CREATE CAST disallows creating a binary-coercible cast to a domain 
> (because that would bypass checking the domain constraints).  But it 
> allows it if the domain is wrapped inside a range type:
> ...
> This particular case seems straightforward to fix, but maybe there are 
> also cases with more nesting to consider.

I think it's an oversight that we allow binary-coercible casts
involving range types at all.  There are no other nesting cases to
worry about, because CreateCast already rejects binary-coercible casts
applied to composites and arrays, explaining

         * We know that composite, enum and array types are never binary-
         * compatible with each other.  They all have OIDs embedded in them.

But range types also embed their own OID, so I don't see why that
concern doesn't apply to them.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: server crash on raspberry pi for large queries
Next
From: Tom Lane
Date:
Subject: Re: CREATE CAST allows creation of binary-coercible cast to range over domain