On Mon, 2003-06-16 at 07:53, Brian O'Donoghue wrote:
> I'm running two different strains of PostgreSQL
>=20
> 7.1.3, which is what our website is running off of now and 7.3.3, which we
> hope to move to (sometime).
>=20
> In 7.1.3 I can say
>=20
> ALTER TABLE blah ADD COLUMN whatever integer not null;
CREATE TABLE bob(col integer);
INSERT INTO bob VALUES (1);
ALTER TABLE bob ADD COLUMN col2 integer NOT NULL;
Now of course, the table has a NULL value for col2 which is not allowed
per the NOT NULL constraint.
Until we allow processing of a DEFAULT expression during column
creation, this will not work that way.
You could argue we should allow NOT NULL to be added to an empty table.
--=20
Rod Taylor <rbt@rbt.ca>
PGP Key: http://www.rbt.ca/rbtpub.asc