Repository navigation
Postgres: Accept generated columns with no mode keyword or VIRTUAL - #2441
Open
ting-hong-shieh wants to merge 5 commits into
Open
ting-hong-shieh wants to merge 5 commits into
ting-hong-shieh wants to merge 5 commits into
Conversation
PostgreSqlDialect required STORED after GENERATED ALWAYS AS (expr), so it rejected both the omitted mode and an explicit VIRTUAL. PostgreSQL 18 documents the grammar as GENERATED ALWAYS AS ( generation_expr ) [ STORED | VIRTUAL ], with VIRTUAL as the default when the keyword is omitted. Remove the PostgreSqlDialect special case so the dialect falls back to the shared handling, which parses both forms and round-trips them unchanged.
LucaCappelletti94
force-pushed
the
postgres-generated-column-mode
branch
from
September 24, 2026 22:09
920f85c to
3f25d96
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2441 +/- ##
=======================================
Coverage 81.02% 81.02%
=======================================
Files 42 42
Lines 33436 33433 -3
Branches 33436 33433 -3
=======================================
- Hits 27090 27089 -1
+ Misses 2789 2787 -2
Partials 3557 3557 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ting-hong-shieh
marked this pull request as ready for review
October 20, 2026 22:41
Author
|
Updated against main Validation: |
Signed-off-by: Ting-Hong Shieh <32212900+ting-hong-shieh@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2407.
PostgreSqlDialectrejectedGENERATED ALWAYS AS (expr)withoutSTORED, including the omitted-mode andVIRTUALforms supported by PostgreSQL 18. Use the existing shared parser handling instead of the PostgreSQL-only restriction.Tests cover omitted mode,
VIRTUAL,STORED, and a followingNOT NULLconstraint. The regression has a committed fuzz seed.Validation for the contents committed as
5eb45ade97d2bf4fca4a0348c57802f701349b83:cargo test --all-features(1,852 passed, 7 ignored),cargo clippy --all-targets --all-features -- -D warnings, formatting, and independent adversarial review. Fuzzing was not rerun for this refresh. Hosted CI may require maintainer approval.AI assistance was used for implementation, conflict resolution, and validation.