| From: | Dmitry Tkach <dmitry(at)openratings(dot)com> |
|---|---|
| To: | Jon Earle <je_pgsql(at)kronos(dot)honk(dot)org> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Nulls get converted to 0 problem |
| Date: | 2003-06-06 14:53:25 |
| Message-ID: | 3EE0AAE5.8090808@openratings.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Henrik Steffen | 2003-06-06 15:03:38 | update phenomenon |
| Previous Message | Stephan Szabo | 2003-06-06 14:47:34 | Re: Create index on the year of a date column |