pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kachun Lee <kachun@pathlink.com>
To: pgsql-sql@hub.org
Subject: Re: [SQL] isnull function]
Date: Fri, 26 Jun 1998 13:33:17 -0700
Message-ID: <3.0.1.32.19980626133317.006bc8cc@rr.pathlink.com> (raw)
In-Reply-To: <199806261913.PAA01028@candle.pha.pa.us>
References: <3.0.1.32.19980626104203.006aadc4@rr.pathlink.com>

At 03:13 PM 6/26/98 -0400, you wrote:
>> 
>> Is there an isnull function avaliable in postgres, such as:
>> 
>>   select isnull(dt_field, 'now') ...
>> 
>> Thanks
>> 
>> 
>
>I don't tbink so, but it would be nice.  I think Ingres has it.  It also
>would not be hard to write as a loadable function.
>
>-- 
>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)
>

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?



view thread (8+ messages)  latest in thread

Message-ID: <3.0.1.32.19980626133317.006bc8cc@rr.pathlink.com>
Permalink:  ../3.0.1.32.19980626133317.006bc8cc@rr.pathlink.com/
Also on:    postgresql.org/message-id/3.0.1.32.19980626133317.006bc8cc@rr.pathlink.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: kachun@pathlink.com, pgsql-sql@hub.org
  Subject: Re: [SQL] isnull function]
  In-Reply-To: <3.0.1.32.19980626133317.006bc8cc@rr.pathlink.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox