Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value)

Поиск
Список
Период
Сортировка
Искать
От
Dean Rasheed
Тема
Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value)
Дата
в 11:42:31
Msg-id
CAEZATCURLESGChXr5ZweoGCGQ9dadM4Hs2eSUjBmXV3OguN4WQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value) SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value) Richard Guo <guofenglinux@gmail.com>
Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value) Chao Li <li.evan.chao@gmail.com>
Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value) SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value) Richard Guo <guofenglinux@gmail.com>
Re: Bug: Rule actions see wrong values for generated columns (NEW.gen reads OLD value) SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
On Mon, 20 Apr 2026 at 08:29, Richard Guo  wrote:
>
> I noticed a couple of issues after a further look.
>
> 1. The ReplaceVarsFromTargetList call on "gen_cols" fails to handle
> hasSubLinks.  This can cause error if targetList contains SubLinks:
>
> update t set a = (select max(a) from t);
> ERROR:  replace_rte_variables inserted a SubLink, but has noplace to record it
>

Doh, yes, careless copy-and-pasting. The updates look good.

> 2. The same bug fixed in this patch also exists in rule quals:
>
> I think we should apply the same fix to CopyAndAddInvertedQual.
>

Agreed.

> Attached v3 fixes them.
>

LGTM.

Regards,
Dean


В списке pgsql-hackers по дате отправления
От: Daniel Gustafsson
Дата:
От: Yuchen Li
Дата:
FAQ