Re: adding not null constraint to existing table

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: adding not null constraint to existing table
Дата
Msg-id Pine.BSF.4.21.0102020940270.21728-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на adding not null constraint to existing table  (Alex Howansky <alex@wankwood.com>)
Список pgsql-general
On Fri, 2 Feb 2001, Alex Howansky wrote:

>
> What's the simplest way to add a not null constraint to a field in an existing
> table? It doesn't seem that alter table supports it -- that I'll have to create
> a new table and copy into it. Is that correct? TIA,

You can also do something to the system catalogs as a superuser to set
attnotnull to true in pg_attribute for the particular attribute you want.

Something like:
update pg_attribute set attnotnull='t' where
pg_attribute.attrelid=pg_class.oid and pg_class.relname=<table> and
attname=<attribute>;


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: plpgsql always returning null..
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Re: sintax???