Re: support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint

Поиск
Список
Период
Сортировка
От Matheus Alcantara
Тема Re: support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint
Дата
Msg-id DFP9Q7B4R7TC.2YTXG1MRFDRFT@gmail.com
обсуждение исходный текст
Ответ на Re: support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint  (jian he <jian.universality@gmail.com>)
Ответы Re: support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint
Список pgsql-hackers
On Thu Jan 15, 2026 at 1:31 AM -03, jian he wrote:
> On Thu, Jan 15, 2026 at 5:02 AM Matheus Alcantara
> <matheusssilv97@gmail.com> wrote:
>>
>> Please see the attached diff for reference.
>
> hi.
> Your patch made the test more simple.
> so i added a ``\d gtest20``
>
> I aslo polished the commit message.
>
Thanks for the new version. The commit message seems better. Just a few
comments:

+    /*
+     * Find everything that depends on the column (constraints, indexes, etc),
+     * and record enough information to let us recreate the objects after
+     * rewrite.
+     */
+    RememberAllDependentForRebuilding(tab, AT_SetExpression, rel, attnum, colName);
+
Perhaps this comments should be updated since we are now collecting
these dependencies for virtual generated columns too that it not require
a table rewrite.

---

I think that it would be good to update the SET EXPRESSION AS
documentation on doc/src/sgml/ref/alter_table.sgml to mention that for
virtual columns the table is not rewritten but a full table scan may
still be needed if the column has check constraints.

--
Matheus Alcantara
EDB: https://www.enterprisedb.com



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