Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.8.8/8.7.5) with ESMTP id WAA11527 for ; Fri, 26 Jun 1998 22:26:55 -0400 (EDT) Received: (from maillist@localhost) by candle.pha.pa.us (8.8.5/8.8.5) id WAA17393; Fri, 26 Jun 1998 22:11:56 -0400 (EDT) From: Bruce Momjian Message-Id: <199806270211.WAA17393@candle.pha.pa.us> Subject: Re: [SQL] isnull function] To: kachun@pathlink.com (Kachun Lee) Date: Fri, 26 Jun 1998 22:11:56 -0400 (EDT) Cc: hackers@postgreSQL.org (PostgreSQL-development) In-Reply-To: <3.0.1.32.19980626133317.006bc8cc@rr.pathlink.com> from "Kachun Lee" at Jun 26, 98 01:33:17 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > I tried, but the following code does not seem to work: > > #include > #include > #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)