Re: 7.3.3 ADD COLUMN wierdness - Mailing list pgsql-bugs

From Rod Taylor
Subject Re: 7.3.3 ADD COLUMN wierdness
Date
Msg-id 1055767740.91882.26.camel@jester
Whole thread Raw
In response to 7.3.3 ADD COLUMN wierdness  ("Brian O'Donoghue" <bodonoghue@stockbyte.com>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: "Brian O'Donoghue"
Date:
Subject: 7.3.3 ADD COLUMN wierdness
Next
From: "Brian O'Donoghue"
Date:
Subject: Re: 7.3.3 ADD COLUMN wierdness