Re: BUG #6701: IS NOT NULL doesn't work on complex composites

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: BUG #6701: IS NOT NULL doesn't work on complex composites
Дата
Msg-id 4FE2E9710200002500048881@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: BUG #6701: IS NOT NULL doesn't work on complex composites  (Rikard Pavelic <rikard.pavelic@zg.htnet.hr>)
Ответы Re: BUG #6701: IS NOT NULL doesn't work on complex composites  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Rikard Pavelic <rikard.pavelic@zg.htnet.hr> wrote:

> The only inconsistent thing is check constraint, which behaves as
> NOT column IS NULL instead of column IS NOT NULL as docs says.

So currently a NOT NULL constraint on a column with a composite type
is equivalent to:

CHECK (NOT c IS NULL)

and the question is whether that is correct, or whether it should be
equivalent to:

CHECK (c IS NOT NULL)

> I even prefer that behavior.

I think I prefer current behavior, too; but I'm inclined to be
guided by the SQL spec if it is unambiguous about which is correct.
(I haven't checked yet -- does anyone already know without having to
dig through the spec?)  Either way, it probably deserves some brief
mention in the docs.  FWIW, a strict reading of the current
PostgreSQL docs ("The column is not allowed to contain null
values.") matches the current behavior, since the other way would
need to be stated as something like "The column can only contain
non-null values."

-Kevin

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

Предыдущее
От: Viswanatham Kiran Kumar
Дата:
Сообщение: Re: log_truncate_on_rotation=on is not truncating
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #6701: IS NOT NULL doesn't work on complex composites