Re: replacing mysql enum

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: replacing mysql enum
Дата
Msg-id 87llc44uht.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: replacing mysql enum  (Ian Barwick <barwick@gmail.com>)
Список pgsql-sql
Ian Barwick <barwick@gmail.com> writes:

> What I still don't quite understand is why IN in a CHECK context is
> handled differently to say: select 1 where 'x' in (null,'a','b','c') ?
> This could be a bit of a gotcha for anyone constructing a constraint
> similar to the original poster's and not realising it has no effect.

well

WHERE foo IN (null, ...)

returns null if foo isn't explicitly in the list (ie, "it may or may not equal
the unknown value in the list"). And I think constraints that return null are
deemed to have succeeded.

-- 
greg



В списке pgsql-sql по дате отправления:

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: Cast NULL into Timestamp?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: replacing mysql enum