Re: BUG #15579: Adding a column with default from configuration parameter fails on 11.1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
Дата
Msg-id 4403.1546894903@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #15579: Adding a column with default from configurationparameter fails on 11.1  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: BUG #15579: Adding a column with default from configurationparameter fails on 11.1  (Andres Freund <andres@anarazel.de>)
Список pgsql-bugs
Andrew Dunstan <andrew@dunslane.net> writes:
> Stable expressions are quite ok for fast defaults. The expression is
> evaluated once when the ALTER TABLE is done and the result (not the
> expression) is stored in the catalog. The reason we check for volatile
> expressions is precisely because we don't want all the existing rows to
> get a single value in that case. This was discussed during the Postgres
> 11 development cycle.

Hmm.

The issue here is that if the table is empty, the old behavior evaluated
the expression zero times during ALTER TABLE.  Now we evaluate it once,
and if that throws an error, that's a user-visible behavior change.

Perhaps it's okay to decide that that's an acceptable behavioral change,
but it makes this feature less transparent than it was supposed to be.

            regards, tom lane


В списке pgsql-bugs по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: BUG #15577: Query returns different results when executedmultiple times
Следующее
От: Andres Freund
Дата:
Сообщение: Re: BUG #15579: Adding a column with default from configurationparameter fails on 11.1