I extracted from the latest multirange patch a bit that creates a new
routine CastCreate() in src/backend/catalog/pg_cast.c. It contains the
catalog-accessing bits to create a new cast. It seems harmless, so I
thought I'd apply it to get rid of a couple of hunks in the large patch.
(I also threw in a move of get_cast_oid from functioncmds.c to
lsyscache.c, which seems its natural place; at first I thought to put it
in catalog/pg_cast.c but really it's not a great place IMO. This
function was invented out of whole cloth in commit fd1843ff8979. I also
contemplated the move of CreateCast and DropCastById from functioncmds.c
to some new place, but creating a new commands/castcmds.c seemed a bit
excessive, so I left them in their current locations.)
--
Álvaro Herrera 39°49'30"S 73°17'W
"The problem with the future is that it keeps turning into the present"
(Hobbes)