Alter table not correct for Postgres 8.0+ - Mailing list pgadmin-support

From Gary Doades
Subject Alter table not correct for Postgres 8.0+
Date
Msg-id 419F9055.2020105@gpdnet.co.uk
Whole thread Raw
List 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 by date:

Previous
From: Mike.Blackwell@rrd.com
Date:
Subject: Re: rc-1 problem with long text fields?
Next
From: Raphaël Enrici
Date:
Subject: [mostly solved] pgAdmin III 1.2.0 RC2 Debian packages available