ADD CONSTRAINT NOT NULL, how?

Поиск
Список
Период
Сортировка
От Lutz Horn
Тема ADD CONSTRAINT NOT NULL, how?
Дата
Msg-id 20020518102011.GA1420@lutz-horn.de
обсуждение исходный текст
Ответы Re: ADD CONSTRAINT NOT NULL, how?
Список pgsql-novice
Hi all,

I'm trying to add a column with "NOT NULL" to an existing table using
the ALTER TABLE command.

db=> ALTER TABLE t1 ADD COLUMN f2 integer NOT NULL;
ERROR:  Adding NOT NULL columns is not implemented.
        Add the column, then use ALTER TABLE ADD CONSTRAINT.

OK, this is not the way to do it. The solution seems to be to first add
the column without "NOT NULL" and use "ADD CONSTRAINT" later. My problem
ist: what ist the syntax for adding this constraint?

BTW, im running "PostgreSQL 7.2.1 on i686-pc-linux-gnu".

Regards
Lutz

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

Предыдущее
От: gerry.smit@lombard.ca
Дата:
Сообщение: Re: Answering my own question
Следующее
От: bob parker
Дата:
Сообщение: Re upgrading 7.1 to 7.2