| От | Tom Lane |
|---|---|
| Тема | Re: Returning NULL to a set returning C type function |
| Дата | |
| Msg-id | 3247.1305138219@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Returning NULL to a set returning C type function (Bborie Park <bkpark@ucdavis.edu>) |
| Ответы |
Re: Returning NULL to a set returning C type function
|
| Список | pgsql-general |
Bborie Park <bkpark@ucdavis.edu> writes:
> I have a C type function that returns a set of a type. The problem I
> have is that the underlying function may return NULL. When the
> underlying function returns NULL, I get the error message:
> ERROR: function returning set of rows cannot return null value
> I'm wondering what is the proper way to correct this problem?
Don't do that ;-). You could choose either to not return any row
at all when this happens, or to construct an all-nulls row to return.
ExecMakeTableFunctionResult doesn't want to guess which behavior is
appropriate for your use-case, so it just complains.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера