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

Поиск
Список
Период
Сортировка
Искать
От
Joe Horsnell
Тема
Re: Behaviour adding a column with and without a default (prior toPG11)
Дата
Msg-id
6D7DB32C-A4BC-4FB1-9AB8-F2E035D14A59@bambooloans.com
Ответ на
Список
Дерево обсуждения
Behaviour adding a column with and without a default (prior to PG11) Joe Horsnell <Joe@bambooloans.com>
Re: Behaviour adding a column with and without a default (prior to PG11) Tom Lane <tgl@sss.pgh.pa.us>
Re: Behaviour adding a column with and without a default (prior toPG11) Joe Horsnell <Joe@bambooloans.com>
Re: Behaviour adding a column with and without a default (prior toPG11) Joe Horsnell <Joe@bambooloans.com>
Thanks for the quick response Tom.

Cheers,

Joe.

On 30/09/2019, 22:19, "Tom Lane"  wrote:

    Joe Horsnell  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



[Bamboo Limited | 1st Floor | Grenville House | Nelson Gate | Southampton | SO15 1GX ::: www.bambooloans.com]
This email message is intended only for the addressee(s) and contains information that may be confidential and/or copyright. If you are not the intended recipient please notify the sender by reply email and immediately delete this email. Use, disclosure or reproduction of this email by anyone other than the intended recipient(s) is strictly prohibited. Although, all emails are scanned for viruses, no representation is made that this email or any attachments are free of viruses. Virus scanning is recommended and is the responsibility of the recipient.
Help protect our environment by only printing this email if absolutely necessary.
В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
От: Nicolas Lehman
Дата:
FAQ