-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
49525: sql: add the `GENERATED ALWAYS` alias for computed columns r=knz a=rohany Fixes #42418. This PR adds an alias to create computed columns with the Postgres syntax that uses `GENERATED ALWAYS`. Due an unfortunate ambiguity caused by the `CREATE FAMILY` column qualifications, the parser cannot tell with a single lookahead token what to do in the case of ``` CREATE TABLE t (x INT CREATE FAMILY GENERATED...) ``` Here, with only 1 token of lookahead, we don't know whether GENERATED is that start of the generated computed clause, or the name of the family. To rectify this, we use the same trick used in other cases, where the lexer will generate a new `GENERATED_ALWAYS` token that allows us to get past the ambiguity here. Release note (sql change): Add the Postgres syntax `GENERATED ALWAYS` alias for computed column construction. Co-authored-by: Rohan Yadav <[email protected]>
- Loading branch information
Showing
6 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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