Re: Nulls get converted to 0 problem

Поиск
Список
Период
Сортировка
От Dmitry Tkach
Тема Re: Nulls get converted to 0 problem
Дата
Msg-id 3EE0AAE5.8090808@openratings.com
обсуждение исходный текст
Ответ на Re: Nulls get converted to 0 problem  (Jon Earle <je_pgsql@kronos.honk.org>)
Список pgsql-general
>
>
>If you're testing a value, you're testing to see if there's something in
>there or not - what difference does it make if the variable contains 0, ""
>or NULL?
>
>
World of difference :-)
An intereger value of 0 is *certainly* "somethign", as well as an empty
string.

>Why not adhere to the practices inherent (and thus anticipated by
>developers) in other languages (C comes to mind) where 0, NULL and "" are
>equivalent?
>
Not at all. An empty string in C is a valid pointer to a memory
location, that contains a 0, and NULL is a pointer to a memory location
that does not exist.
They are not equivalent at all.

Dima




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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: EXTERN JOIN with WHEN query
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: implicit type conversions