以下是10版本中的说明
即在11版本之前:
ALTER TABLE x ADD COLUMN z text;
it was virtually instantaneous. Get a lock on table, add information about new column to system catalogs, and it's done.
But when you tried:
ALTER TABLE x ADD COLUMN z text DEFAULT 'some value';
then it took long time. How long it did depend on size of table.
This was because postgresql was actually rewriting the whole table, adding the column to each row, and filling it with default value.