Re: making functions take arrays

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: making functions take arrays
Дата
Msg-id 19197.982001461@sss.pgh.pa.us
обсуждение исходный текст
Ответ на making functions take arrays  (Kyle <kaf@nwlink.com>)
Список pgsql-general
Kyle <kaf@nwlink.com> writes:
> Is it possible to make a compiled C function take an array as an
> argument?

Sure, although disassembling the array is not quite trivial (a Postgres
array is not the same as a C array).  In the 7.1 code, there is a
deconstruct_array() function in src/backend/utils/adt/arrayfuncs.c
that will help.

> Also, how do I return an SQL NULL from a function?

In 7.0, you don't.  In 7.1, see src/backend/utils/fmgr/README.

            regards, tom lane

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

Предыдущее
От: Kyle
Дата:
Сообщение: making functions take arrays
Следующее
От: Nelio Alves Pereira Filho
Дата:
Сообщение: System Tables