From: | Keary Suska <hierophant(at)pcisys(dot)net> |
---|---|
To: | Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Empty date |
Date: | 2005-04-03 22:50:01 |
Message-ID: | BE75C129.1C080%hierophant@pcisys.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
on 3/30/05 11:43 PM, noeetasoftspam(at)online(dot)ee purportedly said:
> I have a ODBC client which uses empty dates in its native data engine.
> Unfortunately, empty data causes error if trying to store it.
> This is serious Postgres limitation.
> For a partial fix ODBC driver or postgres should convert empty dates to
> NULLs automatically. This is better that producing error.
>
>>> How can " " be a valid date? <<
>>> You might want to reconsider your design. <<
>
> Using your logic, I can ask: How can be 0 valid number ? If there is not
> empty dates, number 0 cannot be also legal.
It's mathematics 101. 0 *is* a valid integer. The SQL standard defines that
any field must either have a valid value, or be NULL, which means "no
value"--and not any idea of "not entered" because you can very easily enter
a NULL value into any field. Therefore logic would dictate that a field
either has a value, or it doesn't, in SQL, this means it has a (valid) value
or is NULL.
> Empty data is a date which is less that all other dates. It can be used in
> comparisons.
> In contract, NULL date means that date is not entered.
There is no such thing as an "empty date". Just like there is no such thing
as an empty boolean, or an empty number. The mistaken notion of "empty" date
seems to proceed from the concept of an "empty string", which is in no way
applicable to any other data type. A string is an array of bytes of X length
where X is an integer. So an "empty" string is just an array of bytes of
zero length.
Looking at dates again, when is 0 date? I suppose Postgres could include the
current computations for the occurrence of the "big bang" but the storage
requirements for such an number, simply to store a current date, would be
highly impractical.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2005-04-03 22:59:51 | Re: Strange plpgsql performance -- arithmetic, numeric() |
Previous Message | Pavel Stehule | 2005-04-03 21:17:41 | Re: How to query pgsql from a BASH script ? |