diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-11 12:46:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-11 12:46:10 +0000 |
commit | d142aecb38fbfd35bf2a0732f5391a807bff3a5e (patch) | |
tree | f5430f0e6a127d39c663e958045aa1bbb462c58b /tests/dialects/test_postgres.py | |
parent | Releasing debian version 15.0.0-1. (diff) | |
download | sqlglot-d142aecb38fbfd35bf2a0732f5391a807bff3a5e.tar.xz sqlglot-d142aecb38fbfd35bf2a0732f5391a807bff3a5e.zip |
Merging upstream version 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)""" ) |