Re: support ALTER TABLE DROP EXPRESSION for virtual generated column

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: support ALTER TABLE DROP EXPRESSION for virtual generated column
Дата
Msg-id CAKFQuwZt41PbKGwc4rFeZsrUZ0jiunrZ7macvQyhm6QLNwBrPQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: support ALTER TABLE DROP EXPRESSION for virtual generated column  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: support ALTER TABLE DROP EXPRESSION for virtual generated column
Список pgsql-hackers
On Wednesday, March 26, 2025, Tom Lane <tgl@sss.pgh.pa.us> wrote:
jian he <jian.universality@gmail.com> writes:
> the attached patch is to implement $subject.

Why would this be a good idea?  I don't see any principled fallback
definition of the column.  (No, "NULL" is not that.)  Certainly we
should support ALTER TABLE DROP COLUMN, but removing the expression
and not providing a substitute seems semantically nonsensical.

I don’t follow how NULL got involved in this discussion. The proposal is basically: turn the virtual expression into an equivalent stored expression, then drop the expression.

I suppose it would make sense to first add an alter table command to allow the user to do a virtual/stored mode swap manually before adding this, which then just becomes a convenient way to specify swap-and-drop as a single command.

David J.

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