summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_postgres.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-07 18:09:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-07 18:09:27 +0000
commite4c72fd7c8018d9dfc6043e7304275e2fffac89f (patch)
treefb9c5556844d46d0e59cc31f129d03502f06f571 /tests/dialects/test_postgres.py
parentAdding upstream version 11.2.3. (diff)
downloadsqlglot-e4c72fd7c8018d9dfc6043e7304275e2fffac89f.tar.xz
sqlglot-e4c72fd7c8018d9dfc6043e7304275e2fffac89f.zip
Adding upstream version 11.3.0.upstream/11.3.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_postgres.py')
-rw-r--r--tests/dialects/test_postgres.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/dialects/test_postgres.py b/tests/dialects/test_postgres.py
index f0117bc..5c4a23e 100644
--- a/tests/dialects/test_postgres.py
+++ b/tests/dialects/test_postgres.py
@@ -107,6 +107,47 @@ class TestPostgres(Validator):
self.validate_identity("x ~* 'y'")
self.validate_all(
+ "1 / 2",
+ read={
+ "drill": "1 / 2",
+ "duckdb": "1 / 2",
+ "postgres": "1 / 2",
+ "presto": "1 / 2",
+ "redshift": "1 / 2",
+ "sqlite": "1 / 2",
+ "teradata": "1 / 2",
+ "trino": "1 / 2",
+ "tsql": "1 / 2",
+ },
+ write={
+ "drill": "1 / 2",
+ "duckdb": "1 / 2",
+ "postgres": "1 / 2",
+ "presto": "1 / 2",
+ "redshift": "1 / 2",
+ "sqlite": "1 / 2",
+ "teradata": "1 / 2",
+ "trino": "1 / 2",
+ "tsql": "1 / 2",
+ "bigquery": "CAST(1 / 2 AS INT64)",
+ "clickhouse": "CAST(1 / 2 AS Int32)",
+ "databricks": "CAST(1 / 2 AS INT)",
+ "hive": "CAST(1 / 2 AS INT)",
+ "mysql": "CAST(1 / 2 AS INT)",
+ "oracle": "CAST(1 / 2 AS NUMBER)",
+ "snowflake": "CAST(1 / 2 AS INT)",
+ "spark": "CAST(1 / 2 AS INT)",
+ "starrocks": "CAST(1 / 2 AS INT)",
+ },
+ )
+ self.validate_all(
+ "SELECT (DATE '2016-01-10', DATE '2016-02-01') OVERLAPS (DATE '2016-01-20', DATE '2016-02-10')",
+ write={
+ "postgres": "SELECT (CAST('2016-01-10' AS DATE), CAST('2016-02-01' AS DATE)) OVERLAPS (CAST('2016-01-20' AS DATE), CAST('2016-02-10' AS DATE))",
+ "tsql": "SELECT (CAST('2016-01-10' AS DATE), CAST('2016-02-01' AS DATE)) OVERLAPS (CAST('2016-01-20' AS DATE), CAST('2016-02-10' AS DATE))",
+ },
+ )
+ self.validate_all(
"x ^ y",
write={
"": "POWER(x, y)",