diff options
Diffstat (limited to '')
-rw-r--r-- | sqlglot/dialects/redshift.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sqlglot/dialects/redshift.py b/sqlglot/dialects/redshift.py index a64c1d4..135ffc6 100644 --- a/sqlglot/dialects/redshift.py +++ b/sqlglot/dialects/redshift.py @@ -136,11 +136,11 @@ class Redshift(Postgres): refs.add( ( this.args["from"] if i == 0 else this.args["joins"][i - 1] - ).alias_or_name.lower() + ).this.alias.lower() ) - table = join.this - if isinstance(table, exp.Table): + table = join.this + if isinstance(table, exp.Table) and not join.args.get("on"): if table.parts[0].name.lower() in refs: table.replace(table.to_column()) return this @@ -158,6 +158,7 @@ class Redshift(Postgres): "UNLOAD": TokenType.COMMAND, "VARBYTE": TokenType.VARBINARY, } + KEYWORDS.pop("VALUES") # Redshift allows # to appear as a table identifier prefix SINGLE_TOKENS = Postgres.Tokenizer.SINGLE_TOKENS.copy() |