Re: support create index on virtual generated column.

From: Soumya S Murali <soumyamurali(dot)work(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: support create index on virtual generated column.
Date: 2026-03-04 05:43:33
Message-ID: CAMtXxw-iMDj1=7yD1Dk8dvCwXSWWzQ58hdbTVHdaXAwL5+ytuw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-Add-test-for-virtual-generated-column-index-restrict.patch text/x-patch 6.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2026-03-04 05:50:24 Need to install liblz4-dev
Previous Message Xuneng Zhou 2026-03-04 05:33:21 Re: Refactor recovery conflict signaling a little