Joe Horsnell <Joe@bambooloans.com> writes:
> The documentation (https://www.postgresql.org/docs/10/ddl-alter.html) clearly states that adding a column with a
defaultrequires updating all the rows in the table, to store the new column value (this is prior to PG11, obviously).
> Obviously the desired effect of adding the column default without rewriting all the rows in the table can be achieved
byadding the nullable column first with no default, then changing the default, but out of curiosity; was there a
specifictechnical reason for the behaviour described above, or was it a conscious design choice?
We read the SQL spec as requiring this behavior.
regards, tom lane