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

From Brian O'Donoghue
Subject Re: 7.3.3 ADD COLUMN wierdness
Date
Msg-id COEDIADJBHCFBMAMDEBBEEGKCAAA.bodonoghue@stockbyte.com
Whole thread Raw
In response to 7.3.3 ADD COLUMN wierdness  ("Brian O'Donoghue" <bodonoghue@stockbyte.com>)
Responses Re: 7.3.3 ADD COLUMN wierdness  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Ah yes.


ALTER TABLE blah ADD COLUMN whatever integer;
UPDATE blah set whatever=1;
ALTER TABLE blah ALTER COLUMN whatever SET NOT NULL;

Produces the desired effect.

I was thinking something along the lines of

ALTER TABLE blah ADD COLUMN whatever integer not null default 1;
should work, but the above is just as handy.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________

pgsql-bugs by date:

Previous
From: Rod Taylor
Date:
Subject: Re: 7.3.3 ADD COLUMN wierdness
Next
From: Tom Lane
Date:
Subject: Re: 7.3.3 ADD COLUMN wierdness