| От | Dani Oderbolz |
|---|---|
| Тема | Re: Create Table Unique problem... bug? |
| Дата | |
| Msg-id | 3ED4C7D9.80002@ecologic.de обсуждение исходный текст |
| Ответ на | Create Table Unique problem... bug? (Mauro Bertoli <bertolima@yahoo.it>) |
| Список | pgsql-novice |
Mauro Bertoli wrote: >Hi, I've a problem creating a table. My Sql >instruction is: > >CREATE TABLE questiontypes ( > id integer NOT NULL, > flags integer, > label text, > UNIQUE (id,flags) >); > >Is it ok?? I must have 'flags' like to NULL... but >'id' is NOT NULL... >Now if I insert a row: > >INSERT INTO questiontypes (id,flags,label) values >(2,null,'a'); > >and re-insert it... I can!!!! Now there are two >identical row, and UNIQUE?? >I think postgres must occur an error? Is it Ok? > Hi Mauro, yes, this is ok, because NULL is not equal to NULL. (In other words, every NULL is a Unique NULL). Every comparison to NULL returns NULL. Regards, Dani
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера