Skip site navigation (1) Skip section navigation (2)

Re: BUG #4125: Strange ALTER TABLE behavior

From: Vladimir Kanazir <vladimir(at)vlajko(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4125: Strange ALTER TABLE behavior
Date: 2008-04-23 15:49:37
Message-ID: 200804231749.37767.vladimir@vlajko.com (view raw or flat)
Thread:
Lists: pgsql-bugs
> > But, if I do this:
> > alter table history add incoming_id bigint;
> > alter table history alter incoming_id set default 0;
> > update history set incoming_id=0;
> > the table will be locked only during alter table execution, which
> > is very short time.
>
> But this exposes the state where incoming_id isn't zero to other
> transactions.

Yes, I can see your point... But if there is a system running, this will 
lock it up even current transactions doesn't care about the new field. 
That is how I noticed this :)

But, I guess, you can't make everybody happy :)
Thanks
-- 
Regards
Vladimir Kanazir

In response to

pgsql-bugs by date

Next:From: Alvaro HerreraDate: 2008-04-23 15:56:44
Subject: Re: HELP pls
Previous:From: Tom LaneDate: 2008-04-23 15:29:39
Subject: Re: BUG #4125: Strange ALTER TABLE behavior

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group