Re: detecting NULL column in SPI function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: detecting NULL column in SPI function
Дата
Msg-id 26080.970154455@sss.pgh.pa.us
обсуждение исходный текст
Ответ на detecting NULL column in SPI function  (Louis-David Mitterrand <cunctator@apartia.ch>)
Список pgsql-general
Louis-David Mitterrand <cunctator@apartia.ch> writes:
> In the provided example SPI functions I couldn't determine a good way of
> testing for NULL on columns. Should I first try to return the Datum,
> test it for NULL, then run DatumGetFloat64() on it? Isn't there a
> simpler way?

Yes.  No.  The Datum is a pointer, so if you indirect through it
before having checked for null-ness, you WILL get a crash.

            regards, tom lane

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

Предыдущее
От: "Mitch Vincent"
Дата:
Сообщение: Re: Talking with other Dbases.
Следующее
От: "Daryl Chance"
Дата:
Сообщение: Fw: Talking with other Dbases.