Re: CHECK col A not NULL if col B='x'

Поиск
Список
Период
Сортировка
От T E Schmitz
Тема Re: CHECK col A not NULL if col B='x'
Дата
Msg-id 41597CD2.1030602@numerixtechnology.de
обсуждение исходный текст
Ответ на Re: CHECK col A not NULL if col B='x'  (Martin Marques <martin@bugs.unl.edu.ar>)
Ответы Re: CHECK col A not NULL if col B='x'
Список pgsql-sql
Hello again,


Martin Marques wrote:

> El Mar 28 Sep 2004 11:02, T E Schmitz escribió:
> 
>>Is it possible to set up a table CHECK, which ensures that column A is
>>NOT NULL if column B = 'x' ?
> 
> 
> CONSTRAINT somename CHECK (B <> 'x' OR A IS NOT NULL)

I noticed a table constraint can be added via ALTER TABLE. Is it correct 
that a column constraint cannot be added via the ALTER TABLE other than 
by dropping and adding the column? (I am using psql 7.4.2.)

-- 


Regards/Gruß,

Tarlika Elisabeth Schmitz


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

Предыдущее
От: T E Schmitz
Дата:
Сообщение: Re: CHECK col A not NULL if col B='x'
Следующее
От: Paul Thomas
Дата:
Сообщение: Re: Doubt