Skip to content

Commit 337885b

Browse files
authored
fix(pgsql): (issue #255) select from support view name (#257)
Co-authored-by: zhaoge <>
1 parent ecbbee3 commit 337885b

6 files changed

Lines changed: 15445 additions & 15278 deletions

File tree

src/grammar/pgsql/PostgreSQLParser.g4

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3258,7 +3258,7 @@ from_list
32583258

32593259
table_ref
32603260
: (
3261-
relation_expr opt_alias_clause? tablesample_clause?
3261+
(relation_expr | view_relation_expr) opt_alias_clause? tablesample_clause?
32623262
| func_table func_alias_clause?
32633263
| xmltable opt_alias_clause?
32643264
| select_with_parens opt_alias_clause?
@@ -3307,6 +3307,10 @@ relation_expr
33073307
| KW_IN KW_SCHEMA (schema_name | KW_CURRENT_SCHEMA)
33083308
;
33093309

3310+
view_relation_expr
3311+
: KW_ONLY? view_name STAR? columnlist? where_clause?
3312+
;
3313+
33103314
publication_relation_expr
33113315
: KW_TABLE KW_ONLY? table_name STAR? (OPEN_PAREN columnlist CLOSE_PAREN)? where_clause?
33123316
| KW_TABLE KW_ONLY ( table_name | OPEN_PAREN table_name CLOSE_PAREN)

src/lib/pgsql/PostgreSQLParser.interp

Lines changed: 2 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)