summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/redshift.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-12 10:17:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-12 10:17:16 +0000
commit7457677bc603569692329e39a59ccb018306e2a6 (patch)
treebb16c8f909bfbf7ff272cd8ef14a413c47b203fe /sqlglot/dialects/redshift.py
parentReleasing debian version 11.3.3-1. (diff)
downloadsqlglot-7457677bc603569692329e39a59ccb018306e2a6.tar.xz
sqlglot-7457677bc603569692329e39a59ccb018306e2a6.zip
Merging upstream version 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.