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

From Peter Eisentraut
Subject Re: CREATE CAST allows creation of binary-coercible cast to range over domain
Date
Msg-id 2e7acd5f-5d34-4802-a5e2-fa36433d133c@eisentraut.org
Whole thread Raw
In response to Re: CREATE CAST allows creation of binary-coercible cast to range over domain  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CREATE CAST allows creation of binary-coercible cast to range over domain
List pgsql-bugs
On 20.08.24 19:30, Tom Lane wrote:
> I wrote:
>> 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.
> 
> In short, more or less as attached.  (I didn't bother with a
> regression test, since none of the adjacent error checks are
> covered either.)

This patch looks right.

> I'm unsure whether to back-patch this.  If somebody were using
> such a cast today, it might seem to mostly work, as long as the
> two kinds of ranges had the same behavior.  So they might not
> appreciate us breaking it in a minor release.  Maybe we should
> put this into 17 but not further back.

Yeah, 17 and up seems ok to me.




pgsql-bugs by date:

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