Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
>> Hmm, maybe it should be using regprocedure instead?
>
> Not unless you want to break initdb. The only reason regproc still
> exists, really, is to accommodate loading of pg_type during initdb.
> Guess what: we can't do type lookup at that point.
Do you mean something like this:
Datum
regprocout(PG_FUNCTION_ARGS)
{
...
if( donot_resolve_procname == TRUE) { result = (char *) palloc(NAMEDATALEN); snprintf(result, NAMEDATALEN,
"%u",proid); }
...
PG_RETURN_CSTRING(result);
}
donot_resolve_procname will be set when COPY will be performed.
Zdenek