summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_postgres.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-06 07:48:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-06 07:48:08 +0000
commitb737ee75da2515a4a53956e41ae85e29dd67f21d (patch)
tree3896f4cac8aebc31f5cdb32a111fa801aba7ca22 /tests/dialects/test_postgres.py
parentAdding upstream version 17.7.0. (diff)
downloadsqlglot-b737ee75da2515a4a53956e41ae85e29dd67f21d.tar.xz
sqlglot-b737ee75da2515a4a53956e41ae85e29dd67f21d.zip
Adding upstream version 17.9.1.upstream/17.9.1
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.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/dialects/test_postgres.py b/tests/dialects/test_postgres.py
index b35665b..be34d8c 100644
--- a/tests/dialects/test_postgres.py
+++ b/tests/dialects/test_postgres.py
@@ -122,6 +122,10 @@ class TestPostgres(Validator):
)
def test_postgres(self):
+ expr = parse_one("SELECT * FROM r CROSS JOIN LATERAL UNNEST(ARRAY[1]) AS s(location)")
+ unnest = expr.args["joins"][0].this.this
+ unnest.assert_is(exp.Unnest)
+
self.validate_identity("CAST(x AS MONEY)")
self.validate_identity("CAST(x AS INT4RANGE)")
self.validate_identity("CAST(x AS INT4MULTIRANGE)")
@@ -414,7 +418,7 @@ class TestPostgres(Validator):
},
)
self.validate_all(
- "SELECT * FROM r CROSS JOIN LATERAL unnest(array(1)) AS s(location)",
+ "SELECT * FROM r CROSS JOIN LATERAL UNNEST(ARRAY[1]) AS s(location)",
write={
"postgres": "SELECT * FROM r CROSS JOIN LATERAL UNNEST(ARRAY[1]) AS s(location)",
},