Alter table not correct for Postgres 8.0+

Поиск
Список
Период
Сортировка
От Gary Doades
Тема Alter table not correct for Postgres 8.0+
Дата
Msg-id 419F9055.2020105@gpdnet.co.uk
обсуждение исходный текст
Список pgadmin-support
If I try to add a column that is not null with a default the SQL that 
gets generated is:

ALTER TABLE control   ADD COLUMN security_options int;
ALTER TABLE control   ALTER COLUMN security_options SET NOT NULL;
ALTER TABLE control   ALTER COLUMN security_options SET DEFAULT 32;

This generates an error if the table already contains rows.

Whereas from 8.0 the following will work and ought to be used instead:

ALTER TABLE control   ADD COLUMN security_options int not null default 32;


Thanks,
Gary.


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

Предыдущее
От: Mike.Blackwell@rrd.com
Дата:
Сообщение: Re: rc-1 problem with long text fields?
Следующее
От: Raphaël Enrici
Дата:
Сообщение: [mostly solved] pgAdmin III 1.2.0 RC2 Debian packages available