Re: support create index on virtual generated column.
Soumya S Murali <soumyamurali.work@gmail.com>
From: Soumya S Murali <soumyamurali.work@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: Corey Huinker <corey.huinker@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-04T05:43:33Z
Lists: pgsql-hackers
Attachments
- 0001-Add-test-for-virtual-generated-column-index-restrict.patch (text/x-patch) patch 0001
Hi all, While validating the bootstrap crash fix for the virtual generated column index patch, I reviewed the current regression coverage around this area. During this process, I noticed that the existing regression suite verifies the functional restrictions on virtual generated columns, but there is no dedicated regression test specifically covering index-related restrictions. As this patch touches index creation logic and also exposes a bootstrap-time crash during testing, it may be useful to add explicit regression coverage for these cases. Having a focused test would help ensure that the current restrictions remain stable and that any future changes affecting this area are detected early by the regression framework and may strengthen long-term test coverage. As a small enhancement in this direction, I prepared a regression test that verifies the expected errors for the following scenarios: 1. CREATE INDEX on a virtual generated column 2. Partial index on a virtual generated column 3. PRIMARY KEY on a virtual generated column 4. Expression index referencing a virtual generated column This ensures the current restrictions remain protected by the regression framework and helps detect unintended changes in the future. The attached patch only adds the regression test and expected output. If this finds useful, kindly verify the patch attached herewith and please let me know the thoughts on this. I would be happy to refine or extend the test further. Looking forward to more feedback. Regards, Soumya
Commits
-
Virtual generated columns
- 83ea6c54025b 18.0 cited