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.

Fri, 26 Jun 1998 17:32:33 -0700
Kachun Lee <kachun@pathlink.com>
isnull function