On Mon, 2003-06-16 at 07:53, Brian O'Donoghue wrote: > I'm running two different strains of PostgreSQL > > 7.1.3, which is what our website is running off of now and 7.3.3, which we > hope to move to (sometime). > > In 7.1.3 I can say > > 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. -- Rod Taylor <[EMAIL PROTECTED]> PGP Key: http://www.rbt.ca/rbtpub.asc
signature.asc
Description: This is a digitally signed message part