有一个这样的表:
create table email_stats (
id bigserial primary key,
mailing_list_id int not null,
sended_date timestamp not null,
emails_send bigint not null default 0,
emails_clicks bigint not null default 0
);
现在我们需要向它添加一个新字段。所以任务很简单,
alter table email_stats
add column emails_paid_clicks bigint not null default 0;
这是唯一的问题:平板电脑的大小已经有几十 GB,而且这台平板电脑会alter table长时间阻塞所有写入表的内容。
如何在不停机的情况下添加字段?
PS:奇怪,但是在这里没有找到这么常见的问题

