summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/redshift.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlglot/dialects/redshift.py')
-rw-r--r--sqlglot/dialects/redshift.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sqlglot/dialects/redshift.py b/sqlglot/dialects/redshift.py
index 22ef51c..dc881b9 100644
--- a/sqlglot/dialects/redshift.py
+++ b/sqlglot/dialects/redshift.py
@@ -29,6 +29,8 @@ class Redshift(Postgres):
"NVL": exp.Coalesce.from_arg_list,
}
+ CONVERT_TYPE_FIRST = True
+
def _parse_types(self, check_func: bool = False) -> t.Optional[exp.Expression]:
this = super()._parse_types(check_func=check_func)
@@ -83,6 +85,9 @@ class Redshift(Postgres):
exp.Matches: rename_func("DECODE"),
}
+ # Redshift uses the POW | POWER (expr1, expr2) syntax instead of expr1 ^ expr2 (postgres)
+ TRANSFORMS.pop(exp.Pow)
+
def values_sql(self, expression: exp.Values) -> str:
"""
Converts `VALUES...` expression into a series of unions.