diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-11 12:46:06 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-11 12:46:06 +0000 |
commit | 9dae42c19381cf27dc56bd932aebd780aa66722b (patch) | |
tree | d70521fc9bf401e225f567a2d6acf1c1e4add2fd /tests/dialects/test_postgres.py | |
parent | Adding upstream version 15.0.0. (diff) | |
download | sqlglot-9dae42c19381cf27dc56bd932aebd780aa66722b.tar.xz sqlglot-9dae42c19381cf27dc56bd932aebd780aa66722b.zip |
Adding upstream version 15.2.0.upstream/15.2.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.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/dialects/test_postgres.py b/tests/dialects/test_postgres.py index 1f288c6..972a8c8 100644 --- a/tests/dialects/test_postgres.py +++ b/tests/dialects/test_postgres.py @@ -7,6 +7,7 @@ class TestPostgres(Validator): dialect = "postgres" def test_ddl(self): + self.validate_identity("CREATE TABLE public.y (x TSTZRANGE NOT NULL)") self.validate_identity("CREATE TABLE test (foo HSTORE)") self.validate_identity("CREATE TABLE test (foo JSONB)") self.validate_identity("CREATE TABLE test (foo VARCHAR(64)[])") @@ -85,6 +86,18 @@ class TestPostgres(Validator): ) def test_postgres(self): + self.validate_identity("CAST(x AS INT4RANGE)") + self.validate_identity("CAST(x AS INT4MULTIRANGE)") + self.validate_identity("CAST(x AS INT8RANGE)") + self.validate_identity("CAST(x AS INT8MULTIRANGE)") + self.validate_identity("CAST(x AS NUMRANGE)") + self.validate_identity("CAST(x AS NUMMULTIRANGE)") + self.validate_identity("CAST(x AS TSRANGE)") + self.validate_identity("CAST(x AS TSMULTIRANGE)") + self.validate_identity("CAST(x AS TSTZRANGE)") + self.validate_identity("CAST(x AS TSTZMULTIRANGE)") + self.validate_identity("CAST(x AS DATERANGE)") + self.validate_identity("CAST(x AS DATEMULTIRANGE)") self.validate_identity( """LAST_VALUE("col1") OVER (ORDER BY "col2" RANGE BETWEEN INTERVAL '1 day' PRECEDING AND '1 month' FOLLOWING)""" ) |