Virtual generated columns
Generated columns computed at read time (GENERATED ALWAYS AS ... VIRTUAL) and their follow-ups and bugs.
Versions
- PostgreSQL 20 · worked-on · improved · moderate
- PostgreSQL 19 · shipped · improved · moderate · 2 commits · +289 / -144 lines
- PostgreSQL 18 · shipped · improved · major · 18 commits · +4.5k / -692 lines
- PostgreSQL 17 · worked-on · improved · major
Threads
- BUG #19943: Wrong results under partition with CHECK/NOT NULL on overridden VIRTUAL generated columns
- pgsql: Don't trust NOT NULL on virtual generated columns of partitioned
- CREATE TABLE LIKE with INHERITS skips checks on generated columns
- BUG #19807: CHECK constraint not enforced on partitioned table when partition overrides a virtual generated colu
- [BUG] ON CONFLICT DO UPDATE SET x = EXCLUDED.<virtual-generated-column> errors or silently writes NULL
- postgres_fdw: virtual generated columns vs. IMPORT FOREIGN SCHEMA
- support create index on virtual generated column.
- BUG #19812: Multiple wrong-result and data-integrity issues with virtual generated columns (v18)
- Show expression of virtual columns in error messages
- stale comment in struct AlteredTableInfo
- [Patch] Omit virtual generated columns from test_decoding output
- Infinite Autovacuum loop caused by failing virtual generated column expression
- [PATCH] Rebuild CHECK constraints after generated column SET EXPRESSION
- Disallow whole-row index references with virtual generated columns?
- Fix SET EXPRESSION for virtual columns with whole-row dependencies
- Proposal: Support virtual generated columns in index expressions and predicates
- Fix tuple deformation with virtual generated NOT NULL columns
- [BUG]: WHERE CURRENT OF cursor fail on tables that have virtual generated columns
- Show VIRTUAL keyword for virtual generated columns in pg_dump and psql
- TupleDescAttr bounds checks
- Allow to collect statistics on virtual generated columns
- Align tests for stored and virtual generated columns
- virtual generated column as partition key
- pgsql: Allow ALTER COLUMN SET EXPRESSION on virtual columns with CHECK
- support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint
- [patch] ALTER COLUMN SET EXPRESSION [GENERATED|STORED]
- virtual generated column as partition key
- Virtual Generated Columns
- foreign key on virtual generated column
- bug: virtual generated column can be partition key
- Allow virtual columns in index expressions or predicate
- expand virtual generated columns in get_relation_constraints()
- Don't treat virtual generated columns as missing statistics in vacuumdb --missing-stats-only
- support ALTER TABLE DROP EXPRESSION for virtual generated column
- Virtual generated columns
- pg18: Virtual generated columns are not (yet) safe when superuser selects from them
- domain over virtual generated column
- support virtual generated column not null constraint
- bug: ALTER TABLE ADD VIRTUAL GENERATED COLUMN with table rewrite
- Small code simplification