Adding a column with a default requires updating each row of the table (to store the new column value). However, if no default is specified, PostgreSQL is able to avoid the physical update. So if you intend to fill the column with mostly nondefault values, it's best to add the column with no default, insert the correct values using UPDATE, and then add any desired default as described below.
> On 14 Jul 2019, at 08:12, Daniel Westermann (DWE) <daniel.westermann@dbi-services.com> wrote: > This is not true anymore since PostgreSQL 11, isn't it? If agreed, I would try to write my first patch to remove that. Correct, as long as the default isn’t volatile. This was changed in 16828d5c0, please go ahead and propose a patch. cheers ./daniel
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера