Re: Adding a non-null column without noticeable downtime

Поиск
Список
Период
Сортировка
От Sameer Kumar
Тема Re: Adding a non-null column without noticeable downtime
Дата
Msg-id CADp-Sm5S6nUQBoPEqDRjp6RSBTMfOGg93QXL9XLUk+yEfXyhGA@mail.gmail.com
обсуждение исходный текст
Ответ на Adding a non-null column without noticeable downtime  (Zev Benjamin <zev-pgsql@strangersgate.com>)
Ответы Re: Adding a non-null column without noticeable downtime  (Zev Benjamin <zev-pgsql@strangersgate.com>)
Список pgsql-general
I think index should help.
Why don't you try it out and check the explain plan of it?
If you are planning to break it down as below:
1. ALTER TABLE "foo" ADD COLUMN "bar" boolean;
2. UPDATE foo SET bar = False; -- Done in batches
3. ALTER TABLE "foo" ALTER COLUMN "bar" SET DEFAULT False;
4. ALTER TABLE "foo" ALTER COLUMN "bar" SET NOT NULL;


I would suggest on interchanging operation 2 and 3 in sequence

В списке pgsql-general по дате отправления:

Предыдущее
От: Zev Benjamin
Дата:
Сообщение: Re: Adding a non-null column without noticeable downtime
Следующее
От: john gale
Дата:
Сообщение: cannot delete corrupted rows after DB corruption: tuple concurrently updated