diff options
Diffstat (limited to 'tests/dialects/test_postgres.py')
-rw-r--r-- | tests/dialects/test_postgres.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/dialects/test_postgres.py b/tests/dialects/test_postgres.py index 4e57b36..c391052 100644 --- a/tests/dialects/test_postgres.py +++ b/tests/dialects/test_postgres.py @@ -578,12 +578,18 @@ class TestPostgres(Validator): def test_string_concat(self): self.validate_all( + "SELECT CONCAT('abcde', 2, NULL, 22)", + write={ + "postgres": "SELECT CONCAT(COALESCE(CAST('abcde' AS TEXT), ''), COALESCE(CAST(2 AS TEXT), ''), COALESCE(CAST(NULL AS TEXT), ''), COALESCE(CAST(22 AS TEXT), ''))", + }, + ) + self.validate_all( "CONCAT(a, b)", write={ - "": "CONCAT(COALESCE(a, ''), COALESCE(b, ''))", - "duckdb": "CONCAT(COALESCE(a, ''), COALESCE(b, ''))", - "postgres": "CONCAT(COALESCE(a, ''), COALESCE(b, ''))", - "presto": "CONCAT(CAST(COALESCE(a, '') AS VARCHAR), CAST(COALESCE(b, '') AS VARCHAR))", + "": "CONCAT(COALESCE(CAST(a AS TEXT), ''), COALESCE(CAST(b AS TEXT), ''))", + "duckdb": "CONCAT(COALESCE(CAST(a AS TEXT), ''), COALESCE(CAST(b AS TEXT), ''))", + "postgres": "CONCAT(COALESCE(CAST(a AS TEXT), ''), COALESCE(CAST(b AS TEXT), ''))", + "presto": "CONCAT(CAST(COALESCE(CAST(a AS VARCHAR), '') AS VARCHAR), CAST(COALESCE(CAST(b AS VARCHAR), '') AS VARCHAR))", }, ) self.validate_all( |