On 2019-Dec-20, Paul A Jungwirth wrote:
> Is it permitted to add casts with polymorphic inputs & outputs? Is
> that something that we would actually want to do? I'd probably need
> both the polymorphic and concrete casts so that you could still say
> `int4range(1,2)::int4multirange`.
I'm embarrased to admit that I don't grok the type system well enough
(yet) to answer this question.
> Should I change the coerce code to look for casts among concrete types
> when the function has polymorphic types? I'm pretty scared to do
> something like that though, both because of the complexity and lest I
> cause unintended effects.
Yeah, I suggest to stay away from that. I think this multirange thing
is groundbreaking enough that we don't need to cause additional
potential breakage.
> Should I just give up on implicit casts and require you to specify
> one? That makes it a little more annoying to mix range & multirange
> types, but personally I'm okay with that. This is my preferred
> approach.
+1
> I have some time over the holidays to work on the other changes Alvaro
> has suggested.
I hope not to have made things worse by posting a rebase. Anyway,
that's the reason I posted my other changes separately.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services