summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/redshift.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-12 10:17:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-12 10:17:12 +0000
commite53bec16fb5ba08b2ff8daf3ffe5467a7c24b757 (patch)
treec13a841e8033707ca74d492bac3ebfc5bd9dd393 /sqlglot/dialects/redshift.py
parentAdding upstream version 11.3.3. (diff)
downloadsqlglot-e53bec16fb5ba08b2ff8daf3ffe5467a7c24b757.tar.xz
sqlglot-e53bec16fb5ba08b2ff8daf3ffe5467a7c24b757.zip
Adding upstream version 11.3.6.upstream/11.3.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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.