From cd37a3bcaced9283c20baa52837c96b524baec54 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 10 Oct 2023 10:53:14 +0200 Subject: Merging upstream version 18.11.6. Signed-off-by: Daniel Baumann --- tests/dialects/test_postgres.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tests/dialects/test_postgres.py') diff --git a/tests/dialects/test_postgres.py b/tests/dialects/test_postgres.py index 0ddc106..22bede4 100644 --- a/tests/dialects/test_postgres.py +++ b/tests/dialects/test_postgres.py @@ -648,10 +648,10 @@ class TestPostgres(Validator): }, ) self.validate_all( - "merge into x as x using (select id) as y on a = b WHEN matched then update set X.a = y.b", + """merge into x as x using (select id) as y on a = b WHEN matched then update set X."A" = y.b""", write={ - "postgres": "MERGE INTO x AS x USING (SELECT id) AS y ON a = b WHEN MATCHED THEN UPDATE SET a = y.b", - "snowflake": "MERGE INTO x AS x USING (SELECT id) AS y ON a = b WHEN MATCHED THEN UPDATE SET X.a = y.b", + "postgres": """MERGE INTO x AS x USING (SELECT id) AS y ON a = b WHEN MATCHED THEN UPDATE SET "A" = y.b""", + "snowflake": """MERGE INTO x AS x USING (SELECT id) AS y ON a = b WHEN MATCHED THEN UPDATE SET X."A" = y.b""", }, ) self.validate_all( @@ -724,3 +724,11 @@ class TestPostgres(Validator): "presto": "CONCAT(CAST(a AS VARCHAR), CAST(b AS VARCHAR))", }, ) + + def test_variance(self): + self.validate_all("VAR_SAMP(x)", write={"postgres": "VAR_SAMP(x)"}) + self.validate_all("VAR_POP(x)", write={"postgres": "VAR_POP(x)"}) + self.validate_all("VARIANCE(x)", write={"postgres": "VAR_SAMP(x)"}) + self.validate_all( + "VAR_POP(x)", read={"": "VARIANCE_POP(x)"}, write={"postgres": "VAR_POP(x)"} + ) -- cgit v1.2.3