| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера