View Single Post

   
  #4 (permalink)  
Old 04-09-2008, 02:32 PM
Ron Johnson
 
Posts: n/a
Default Re: How to enforce uniqueness when NULL values are present?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/10/07 18:22, Christian Schröder wrote:
> Peter Eisentraut wrote:

[snip]
> I know that it's always dangerous to quote the Wikipedia. Let me do it
> anyway: "Attributes in tables in SQL database management systems can
> optionally be designated as NULL. This indicates that the actual value
> of the column is unknown _or not applicable_."
> (http://en.wikipedia.org/wiki/Null_%28SQL%29) This is exactly what I
> once learned about NULL values, and "not applicable" is exactly why I
> use NULL values in my example.


I've never heard of NULL meaning "not applicable", but only
"unknown". To me, "not applicable" screams "denormalized".

So, I'd put 1900-01-01 (or whatever is your application's epoch) in
those date fields with NULL values, because that's their effective date.

>
> Regards,
> Christian
>


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFF81kbS9HxQb37XmcRAkq/AJ0b6OkNtZZgNFOT/VGvqIWF2bI7DgCg4Emr
lW+BWZseIkg/Vdf6fpK7dOI=
=7jC/
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Reply With Quote