isnull function

From: Kachun Lee <kachun(at)pathlink(dot)com>
To: pgsql-hackers(at)hub(dot)org
Subject: isnull function
Date: 1998-06-27 00:32:33
Message-ID: 3.0.1.32.19980626173233.006ad940@rr.pathlink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Browse pgsql-hackers by date

  From Date Subject
Next Message Brett McCormick 1998-06-27 01:35:44 operator error
Previous Message Colin Dick 1998-06-26 20:41:22 Re: [SQL] isnull function]