Re: user defined function

Поиск
Список
Период
Сортировка
От Yl Zhou
Тема Re: user defined function
Дата
Msg-id 29d3b0b90601240853x20592bc9hdc5a4cf92b870279@mail.gmail.com
обсуждение исходный текст
Ответ на Re: user defined function  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: user defined function
Список pgsql-general
Do you mean this function? Seems I cannot get much information from it...
/*
 * record_out        - output routine for pseudo-type RECORD.
 */
Datum
record_out(PG_FUNCTION_ARGS)
{
    elog(ERROR, "Cannot display a value of type %s", "RECORD");

    PG_RETURN_VOID();            /* keep compiler quiet */
}


On 1/24/06, Tom Lane <tgl@sss.pgh.pa.us > wrote:
Richard Huxton <dev@archonet.com > writes:
> Tom Lane wrote:
>> You could do that in C, but none of the available PLs support it.

> How would you define the signature for the function? One parameter of
> type anyelement?

Type RECORD would be a better choice --- ANYELEMENT allows scalar types
which is not what you want here.  (You could probably still do it with
a function declared that way, but it'd have to take extra steps to
defend itself against being passed, say, an integer.)

If you're looking for a coding model, stripping down record_out() to
just count nulls should get you there.

                        regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: "George Pavlov"
Дата:
Сообщение: Re: Quoted NULLs with COPY FROM (and pgAdmin export data options)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Access a temporary table of another session - is it possible ?