Re: ALTER TABLE & NOT NULL

Поиск
Список
Период
Сортировка
От Thomas T. Thai
Тема Re: ALTER TABLE & NOT NULL
Дата
Msg-id Pine.NEB.4.43.0204061442220.3593-100000@ns01.minnesota.com
обсуждение исходный текст
Ответ на Re: ALTER TABLE & NOT NULL  (Joe Conway <mail@joeconway.com>)
Список pgsql-general
On Sat, 6 Apr 2002, Joe Conway wrote:

> Thomas T. Thai wrote:
> > How do you alter a column so that it uses NOT NULL? I tried:
> >
> > alter table auth_users alter email set default not null;
> >
> > ERROR:  Column "email" is of type character varying but default expression
> > is of type boolean
> >         You will need to rewrite or cast the expression
> >
>
> I think you have to add a table constraint to do that. Something like:
>
> ALTER TABLE auth_users ADD CONSTRAINT auth_users_email CHECK (email is
> not null);

is this also what happens at the time of table creation when one specifies
that a column is to be NOT NULL?



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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: ALTER TABLE & NOT NULL
Следующее
От: Joe Conway
Дата:
Сообщение: Re: ALTER TABLE & NOT NULL