Fix bugs in polymorphic-argument resolution for multiranges.
authorTom Lane
Tue, 27 Jul 2021 19:01:49 +0000 (15:01 -0400)
committerTom Lane
Tue, 27 Jul 2021 19:01:49 +0000 (15:01 -0400)
commitb7ea0e8c41f1e512923267a57cd08df63115b783
treea06e255a131dae1cd51d66219678bee3911707e9
parentfd90f6ba7a75f51d14dac27219bb3755b893e251
Fix bugs in polymorphic-argument resolution for multiranges.

We failed to deal with an UNKNOWN-type input for
anycompatiblemultirange; that should throw an error indicating
that we don't know how to resolve the multirange type.

We also failed to infer the type of an anycompatiblerange output
from an anycompatiblemultirange input or vice versa.

Per bug #17066 from Alexander Lakhin.  Back-patch to v14
where multiranges were added.

Discussion: https://postgr.es/m/17066-16a37f6223a8470b@postgresql.org
src/backend/parser/parse_coerce.c
src/test/regress/expected/polymorphism.out
src/test/regress/expected/rangefuncs.out
src/test/regress/sql/polymorphism.sql