Matthias Teege <matthias@mteege.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