diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml new file mode 100644 index 5ae3cac..95a326b *** a/doc/src/sgml/ddl.sgml --- b/doc/src/sgml/ddl.sgml *************** ALTER TABLE products ADD COLUMN descript *** 1189,1194 **** --- 1189,1214 ---- value is given (null if you don't specify a DEFAULT clause). + + + From PostgreSQL 11, adding a column with + a constant default value no longer means that each row of the table needs + to be updated when the ALTER TABLE statement is executed. + Instead, the default value will be returned next time the row is accessed, + and applied when the table is rewritten, making the ALTER TABLE + very fast even on large tables. + + + However, if the default value is volatile (e.g. clock_timestamp()) + each row will need to be updated with the value calulated at the time + ALTER TABLE is executed. To avoid a potentially lengthy + update operation, particularly if you intend to fill the column with mostly + nondefault values anyway, it may be preferable to add the column with no default, + insert the correct values using UPDATE, and then add any desired default as + described below. + + + You can also define constraints on the column at the same time, using the usual syntax: *************** ALTER TABLE products ADD COLUMN descript *** 1203,1219 **** correctly. - - - 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. - - --- 1223,1228 ----