BUG #4125: Strange ALTER TABLE behavior

From: "Vladimir Kanazir" <vladimir(at)vlajko(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4125: Strange ALTER TABLE behavior
Date: 2008-04-23 15:01:24
Message-ID: 200804231501.m3NF1OrM017187@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4125
Logged by: Vladimir Kanazir
Email address: vladimir(at)vlajko(dot)com
PostgreSQL version: 8.2.6
Operating system: Fedora 7
Description: Strange ALTER TABLE behavior
Details:

If I execute this query:
alter table history add incoming_id bigint default 0;

the table will be locked until operation finishes (checked by executing the
select query on the same table via another connection).

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.
I think that alter table with default values should work the same way.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2008-04-23 15:29:39 Re: BUG #4125: Strange ALTER TABLE behavior
Previous Message Harald Armin Massa 2008-04-23 14:40:37 Re: