Tom Lane wrote:
> With Joe's recent additions for polymorphic functions, it's even
> possible for the function to discover what it's supposed to return
> at runtime. (Hey Joe, did we make that work for functions called
> from the FROM clause? If not, seems like something to fix up.)
I'm just getting back into the polymorphic-functions/array-expression
changes this weekend. To follow up on the question above, I checked and
found that get_fn_expr_rettype() works fine in FROM clause functions.
Of course, as I mentioned earlier, fcinfo->resultinfo->expectedDesc is
also available in FROM clause functions, and is probably more convenient
to use for return type discovery.
However, get_fn_expr_argtype() is your only real option as far as
discovering run time argument types. I'm sure it also works in FROM
clause functions (because I'm actively using it in plr)
Joe