Re: 7.3.3 ADD COLUMN wierdness

From: "Brian O'Donoghue" <bodonoghue(at)stockbyte(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: 7.3.3 ADD COLUMN wierdness
Date: 2003-06-16 13:43:41
Message-ID: COEDIADJBHCFBMAMDEBBEEGKCAAA.bodonoghue@stockbyte.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
________________________________________________________________________

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-06-16 14:38:55 Re: 7.3.3 ADD COLUMN wierdness
Previous Message Rod Taylor 2003-06-16 12:49:00 Re: 7.3.3 ADD COLUMN wierdness