Disallow creating binary-coercible casts involving range types.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 21 Aug 2024 16:00:03 +0000 (12:00 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 21 Aug 2024 16:00:03 +0000 (12:00 -0400)
commit86488cdf1249f86cff75c2446f670be49cb55055
tree3aa9777c968b64232835571f6f86943d55e5b504
parentc01743aa4866e13da2c54e44010abc6d5f986363
Disallow creating binary-coercible casts involving range types.

For a long time we have forbidden binary-coercible casts to or from
composite and array types, because such a cast cannot work correctly:
the type OID embedded in the value would need to change, but it won't
in a binary coercion.  That reasoning applies equally to range types,
but we overlooked installing a similar restriction here when we
invented range types.  Do so now.

Given the lack of field complaints, we won't change this in stable
branches, but it seems not too late for v17.

Per discussion of a problem noted by Peter Eisentraut.

Discussion: https://postgr.es/m/076968e1-0852-40a9-bc0b-117cd3f0e43c@eisentraut.org
src/backend/commands/functioncmds.c