Re: Why isn't that null

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why isn't that null
Дата
Msg-id 8731.962095662@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Why isn't that null  (Matthias Teege <matthias@mteege.de>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Lincoln Yeoh
Дата:
Сообщение: Re: Transactions and web applications
Следующее
От: "Morten W. Petersen"
Дата:
Сообщение: How to dump from Postgre