Re: BUG #11705: \d(escribe) table shows incorrect check constraint

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: BUG #11705: \d(escribe) table shows incorrect check constraint
Дата
Msg-id 1413837862.43723.YahooMailNeo@web122301.mail.ne1.yahoo.com
обсуждение исходный текст
Ответ на BUG #11705: \d(escribe) table shows incorrect check constraint  (finkel@sd-il.com)
Список pgsql-bugs
"finkel@sd-il.com" <finkel@sd-il.com> wrote:
> We have a table with this constraint:

>
> CONSTRAINT check_m_nullability CHECK (((m1 IS NULL) AND
> (m2 IS NULL)) OR ((m1 IS NOT NULL) AND (m2 IS NOT NULL)))

Michael is right, but in addition to that you might want to use the
simpler (and to my eye easier to read):

CONSTRAINT check_m_nullability CHECK ((m1 IS NULL) = (m2 IS NULL))

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #11703: ERROR: variable not found in subplan target list
Следующее
От: Andres Freund
Дата:
Сообщение: Re: BUG #10675: alter database set tablespace and unlogged table