Re: [SQL] isnull function] - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [SQL] isnull function]
Date
Msg-id 199806270211.WAA17393@candle.pha.pa.us
Whole thread Raw
List pgsql-hackers
>
> I tried, but 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. Should I post this to HACKER?
>
>

Having DateTime* be a NULL does not represent a NULL value in SQL
internally.

Not sure how to do it, because I don't rememeber where the NULL checking
is done.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Brett McCormick
Date:
Subject: operator error
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Problem after removal of exec(), help