Re: PRIMARY KEY on a *group* of columns imply that each column is
От | Ron Mayer |
---|---|
Тема | Re: PRIMARY KEY on a *group* of columns imply that each column is |
Дата | |
Msg-id | 427115AA.8060300@cheapcomplexdevices.com обсуждение исходный текст |
Ответ на | Re: PRIMARY KEY on a *group* of columns imply that each column is (Marco Colombo <pgsql@esiway.net>) |
Список | pgsql-general |
Marco Colombo wrote: > That is, given a variable A, you can always write a boolean expression > that evaluates True or False to test if A is _equal_ to None/undef/NULL > (in C): And of course you can do this in SQL as well. > ('a', NULL) is neither the same _nor different_ from ('a', 2). Uh, I'm not sure what you mean by "the same"; but certainly ('a',NULL) is distinct from ('a',2). >The result of comparison is NULL, no matter how you're testing it: Unless you're testing with the IS DISTINCT FROM operator. fli=# select ('a',NULL) IS DISTINCT FROM ('a',2); ?column? ---------- t (1 row) > marco=# select ('a', 2) = ('a', NULL); > ?column? > ---------- > > (1 row) > > marco=# select ('a', 2) <> ('a', NULL); > ?column? > ---------- > > (1 row) fli=# select ('a',NULL) IS DISTINCT FROM ('a',NULL); ?column? ---------- f (1 row) > That's why NULLs are not allowed in primary keys... But in general I agree with most of the rest of what you said.
В списке pgsql-general по дате отправления: