Postgres: Accept generated columns with no mode keyword or VIRTUAL - #2441
Draft
ting-hong-shieh wants to merge 1 commit into
Draft
Postgres: Accept generated columns with no mode keyword or VIRTUAL#2441ting-hong-shieh wants to merge 1 commit into
ting-hong-shieh wants to merge 1 commit 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.
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.
PostgreSqlDialectrequiredSTOREDafterGENERATED ALWAYS AS (expr), so it rejected both the omitted mode and an explicitVIRTUAL:PostgreSQL 18 documents the grammar as
GENERATED ALWAYS AS ( generation_expr ) [ STORED | VIRTUAL ], withVIRTUALas the default when the keyword is omitted.This removes the
PostgreSqlDialectspecial case so the dialect falls back to the shared handling, which already parses both forms and round-trips them unchanged.STOREDis unaffected.