From f73e9af131151f1e058446361c35b05c4c90bf10 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 7 Sep 2023 13:39:48 +0200 Subject: Merging upstream version 18.2.0. Signed-off-by: Daniel Baumann --- tests/dialects/test_postgres.py | 52 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'tests/dialects/test_postgres.py') diff --git a/tests/dialects/test_postgres.py b/tests/dialects/test_postgres.py index a7719a9..8740aca 100644 --- a/tests/dialects/test_postgres.py +++ b/tests/dialects/test_postgres.py @@ -126,6 +126,8 @@ class TestPostgres(Validator): ) def test_postgres(self): + self.validate_identity("x @@ y") + 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) @@ -534,6 +536,54 @@ class TestPostgres(Validator): "x::cstring", write={"postgres": "CAST(x AS CSTRING)"}, ) + self.validate_all( + "x::oid", + write={"postgres": "CAST(x AS OID)"}, + ) + self.validate_all( + "x::regclass", + write={"postgres": "CAST(x AS REGCLASS)"}, + ) + self.validate_all( + "x::regcollation", + write={"postgres": "CAST(x AS REGCOLLATION)"}, + ) + self.validate_all( + "x::regconfig", + write={"postgres": "CAST(x AS REGCONFIG)"}, + ) + self.validate_all( + "x::regdictionary", + write={"postgres": "CAST(x AS REGDICTIONARY)"}, + ) + self.validate_all( + "x::regnamespace", + write={"postgres": "CAST(x AS REGNAMESPACE)"}, + ) + self.validate_all( + "x::regoper", + write={"postgres": "CAST(x AS REGOPER)"}, + ) + self.validate_all( + "x::regoperator", + write={"postgres": "CAST(x AS REGOPERATOR)"}, + ) + self.validate_all( + "x::regproc", + write={"postgres": "CAST(x AS REGPROC)"}, + ) + self.validate_all( + "x::regprocedure", + write={"postgres": "CAST(x AS REGPROCEDURE)"}, + ) + self.validate_all( + "x::regrole", + write={"postgres": "CAST(x AS REGROLE)"}, + ) + self.validate_all( + "x::regtype", + write={"postgres": "CAST(x AS REGTYPE)"}, + ) self.validate_all( "TRIM(BOTH 'as' FROM 'as string as')", write={ @@ -606,7 +656,7 @@ class TestPostgres(Validator): "a || b", write={ "": "a || b", - "clickhouse": "CONCAT(CAST(a AS TEXT), CAST(b AS TEXT))", + "clickhouse": "CONCAT(CAST(a AS String), CAST(b AS String))", "duckdb": "a || b", "postgres": "a || b", "presto": "CONCAT(CAST(a AS VARCHAR), CAST(b AS VARCHAR))", -- cgit v1.2.3