here's a patch for a utility function to look up the cast function for a
from/to pair of types, as recently suggested by Alvaro. Although it only
contains one use (in json.c), the upcoming jsonb generators would also
use it twice. I'd like to get this committed fairly quickly so I can
prepare an updated patch for the jsonb generators.
cheers
andrew