Re: support create index on virtual generated column.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Corey Huinker <corey.huinker@gmail.com>
Cc: jian he <jian.universality@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-07-22T20:54:45Z
Lists: pgsql-hackers
Corey Huinker <corey.huinker@gmail.com> writes: > I'm interested in this feature, specifically whether the optimizer uses the > index in situations where the expression is used rather than the virtual > column name. Hmm, I kinda think we should not do this. The entire point of a virtual column is that its values are not stored and so you can (for example) change the generation expression "for free". If it's referenced in an index that advantage goes out the window because we'll have to rebuild the index. Besides, this does nothing you haven't been able to do for decades with expression indexes. regards, tom lane
Commits
-
Virtual generated columns
- 83ea6c54025b 18.0 cited