| От | Peter Eisentraut |
|---|---|
| Тема | Re: disallowing multiple NULLs in a unique constraint |
| Дата | |
| Msg-id | 200405121300.07216.peter_e@gmx.net обсуждение исходный текст |
| Ответ на | disallowing multiple NULLs in a unique constraint (David Garamond <lists@zara.6.isreserved.com>) |
| Ответы |
Re: disallowing multiple NULLs in a unique constraint
|
| Список | pgsql-general |
Am Montag, 9. Februar 2004 06:06 schrieb David Garamond: > SQL Server only allow one NULL in a unique constraint column (it's the > unique index that does that, so the unique constraint behaves like that > too). The question is, what is the best way to simulate that behaviour > in Postgres? Can a CHECK constraint does that? Will a trigger with > SELECT count(*) ... WHERE f IS NULL be too slow if the table is large? You can time that yourself (but I suspect it won't be pretty), but I think that you're going to have all kinds of other problems if you base your database schema on the assumption that NULL = NULL. Better fix the application.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера