redundancy in CHECK CONSTRAINTs

Поиск
Список
Период
Сортировка
От Ferindo Middleton Jr
Тема redundancy in CHECK CONSTRAINTs
Дата
Msg-id 43361AB7.2020701@verizon.net
обсуждение исходный текст
Ответы Re: redundancy in CHECK CONSTRAINTs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
I have the following table:

CREATE TABLE gyuktnine (    id               SERIAL,   intsystem      INTEGER NOT NULL REFERENCES yuksystems(id)
CONSTRAINT
 
int_cannot_equal_ext                      CHECK (intsystem != extsystem),   extsystem     INTEGER NOT NULL REFERENCES
yuksystems(id)CONSTRAINT 
 
ext_cannot_equal_int                       CHECK (extsystem != intsystem),    PRIMARY KEY (intsystem, extsystem)
);

the intsystem and extsystem fields both have a check constraint on them 
which preventing any one record from having values in which they are 
equal. There is also a primary key. Is this redundant? Do only one of 
them really need this constraint? Or does it not really matter. I'm 
concerned about using constraints like this and have redundant checks 
built in slowing down my db.

Ferindo


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

Предыдущее
От: Chris Browne
Дата:
Сообщение: Re: stored procs in postgresql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: redundancy in CHECK CONSTRAINTs