Use the macro, not handwritten code, to construct anymultirange_in().

Apparently anymultirange_in was written before we converted all
these pseudotype input functions to use a common macro, and it didn't
get fixed before committing.  Sloppy merging probably explains its
unintuitive ordering, too, so rearrange.

Noted while surveying datatype input functions to see what we
have left to fix.  I'm inclined to leave the pseudotypes as
throwing hard errors, because it's difficult to see a reason why
anyone would need something else.  But in any case, if we want
to change that, we shouldn't have to change multiple copies of
the code.
This commit is contained in:
Tom Lane 2022-12-10 17:22:16 -05:00
parent 94985c2102
commit e730718072
1 changed files with 13 additions and 24 deletions

View File

@ -228,6 +228,19 @@ anycompatiblerange_out(PG_FUNCTION_ARGS)
return range_out(fcinfo);
}
/*
* anymultirange
*
* We may as well allow output, since multirange_out will in fact work.
*/
PSEUDOTYPE_DUMMY_INPUT_FUNC(anymultirange);
Datum
anymultirange_out(PG_FUNCTION_ARGS)
{
return multirange_out(fcinfo);
}
/*
* anycompatiblemultirange
*
@ -241,30 +254,6 @@ anycompatiblemultirange_out(PG_FUNCTION_ARGS)
return multirange_out(fcinfo);
}
/*
* anymultirange_in - input routine for pseudo-type ANYMULTIRANGE.
*/
Datum
anymultirange_in(PG_FUNCTION_ARGS)
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot accept a value of type %s", "anymultirange")));
PG_RETURN_VOID(); /* keep compiler quiet */
}
/*
* anymultirange_out - output routine for pseudo-type ANYMULTIRANGE.
*
* We may as well allow this, since multirange_out will in fact work.
*/
Datum
anymultirange_out(PG_FUNCTION_ARGS)
{
return multirange_out(fcinfo);
}
/*
* void
*