| От | Tom Lane |
|---|---|
| Тема | Re: Returning null from Userdefined C function |
| Дата | |
| Msg-id | 18124.966039465@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Returning null from Userdefined C function (Andrew Selle <aselle@upl.cs.wisc.edu>) |
| Список | pgsql-hackers |
Andrew Selle <aselle@upl.cs.wisc.edu> writes:
> Obviously, there must be some way to create a NULL text * return
> variable,
You would think that, but you'd be wrong :-( --- at least for current
releases; this problem has been fixed for 7.1 by creating a new API
for user-defined functions.
With the old API, for the case of single-argument functions, you can
fake it via an ugly kluge: declare a second argument "bool *isNull"
(at the C level only, not in the SQL definition) and set *isNull to
TRUE if you want to return a NULL. This does not work if the function
doesn't have exactly one SQL argument, however.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера