Search Postgresql Archives

Re: Behaviour adding a column with and without a default (prior to PG11)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Joe Horsnell <Joe@xxxxxxxxxxxxxxx> writes:
> The documentation (https://www.postgresql.org/docs/10/ddl-alter.html) clearly states that adding a column with a default requires 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 by adding the nullable column first with no default, then changing the default, but out of curiosity; was there a specific technical 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






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux