2009/8/11 Tom Lane <tgl@sss.pgh.pa.us>:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
>> I wondered if it should just return char *. If we want to have this
>> functionality as its own fmgr-blessed function, shouldn't it return
>> text instead of cstring?
>
> If we expose it at fmgr level it should definitely not return cstring.
> However, I wasn't foreseeing doing that --- does the submitted patch
> expose it?
>
Sorry, I'm a little hazy on the terminology here. If by "expose it at
fmgr level" you mean did I add it to pg_proc, then no, I didn't.
The function is declared in builtins.h as "extern Datum
numeric_out_sci(PG_FUNCTION_ARGS);", and called from formatting.c
using the DirectFunctionCall arrangement.
numeric_out_sci() returns using PG_RETURN_CSTRING, same as numeric_out does.
If this is the wrong way to expose the function, please let me know
and I'll happily fix it.
Cheers,
BJ