isnull function

Поиск
Список
Период
Сортировка
От Kachun Lee
Тема isnull function
Дата
Msg-id 3.0.1.32.19980626173233.006ad940@rr.pathlink.com
обсуждение исходный текст
Список pgsql-hackers
I tried to implement an is_null function, such as:

   select is_null(dt, 'now'::datetime) ...

The following code does not seem to work:

#include <string.h>
#include <stdio.h>
#include "postgres.h"
#include "libpq-fe.h"
#include "utils/dt.h"

DateTime * is_null(DateTime *, DateTime *);

DateTime * is_null (DateTime * dt, DateTime * def)
{
        return dt ? dt : def;
}

I searched the doc/maillist, and I could not find how to test an arg for
NULL value. Any info or help will be greately appreciated.

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

Предыдущее
От: De Clarke
Дата:
Сообщение: lwn.net
Следующее
От: Brett McCormick
Дата:
Сообщение: operator error