Re: Why isn't that null

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthias Teege <matthias(at)mteege(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why isn't that null
Date: 2000-06-27 08:47:42
Message-ID: 8731.962095662@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthias Teege <matthias(at)mteege(dot)de> writes:
> I have al small problem with ISNULL in a trigger
> function. My definition looks like:

> IF NEW.vkp ISNULL THEN
> ...

> The following SQL query didnt cause this if statement:

> insert into aufpos(auftrag, artikel, best_menge, vkp,
> lieferwoche, cuser, ctime, uuser, utime) values
> ('175','8501900','12','','3500','matthias',
> now (), 'matthias',now ())

This seems correct to me --- an empty string '' is certainly not
the same thing as NULL.

> If I change the function statement as follows:

> IF NEW.vkp = 0 THEN
> ...
> END IF;

> it works

Shouldn't that give a type error of some sort? You didn't say
what type vkp is, but if it's a string type then comparing it
against a numeric shouldn't work IMHO.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message NRonayette 2000-06-27 08:55:46 Re: Why isn't that null
Previous Message Lincoln Yeoh 2000-06-27 08:38:41 Re: Transactions and web applications