isnull function - Mailing list pgsql-hackers

From Kachun Lee
Subject isnull function
Date
Msg-id 3.0.1.32.19980626173233.006ad940@rr.pathlink.com
Whole thread Raw
List 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 by date:

Previous
From: De Clarke
Date:
Subject: lwn.net
Next
From: Brett McCormick
Date:
Subject: operator error