Thread
Commits
-
Fix ALTER TABLE ADD VIRTUAL GENERATED COLUMN when table rewrite
- f011acdd61fc 18.0 landed
-
bug: ALTER TABLE ADD VIRTUAL GENERATED COLUMN with table rewrite
jian he <jian.universality@gmail.com> — 2025-02-27T15:00:51Z
hi. bug demo: CREATE TABLE gtest20a (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) VIRTUAL); ALTER TABLE gtest20a ADD COLUMN c float8 DEFAULT RANDOM() CHECK (b < 60); ERROR: no generation expression found for column number 2 of table "pg_temp_17306" issue is that in ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap) we need use existing (tab->relid) relation get the generated expression, not use OIDNewHeap, since we don't populate OIDNewHeap related generated expressions. The attached patch fixes this issue.
-
Re: bug: ALTER TABLE ADD VIRTUAL GENERATED COLUMN with table rewrite
Srinath Reddy Sadipiralla <srinath2133@gmail.com> — 2025-02-28T13:36:29Z
Hi, I have applied the patch and verified,and patch LGTM. Thanks and regards Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/
-
Re: bug: ALTER TABLE ADD VIRTUAL GENERATED COLUMN with table rewrite
Peter Eisentraut <peter@eisentraut.org> — 2025-03-04T08:28:37Z
On 28.02.25 14:36, Srinath Reddy wrote: > Hi, > I have applied the patch and verified,and patch LGTM. committed, thanks