summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_postgres.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-13 09:17:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-13 09:17:37 +0000
commit22342ec7693d09ebf96484be7c3cd5d8b506f38e (patch)
treeb8fe2ebfb290eb425dcee4f15fa8cab46e74b40f /tests/dialects/test_postgres.py
parentAdding upstream version 18.3.0. (diff)
downloadsqlglot-22342ec7693d09ebf96484be7c3cd5d8b506f38e.tar.xz
sqlglot-22342ec7693d09ebf96484be7c3cd5d8b506f38e.zip
Adding upstream version 18.4.1.upstream/18.4.1
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.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/dialects/test_postgres.py b/tests/dialects/test_postgres.py
index 21196b7..151f3af 100644
--- a/tests/dialects/test_postgres.py
+++ b/tests/dialects/test_postgres.py
@@ -133,6 +133,9 @@ class TestPostgres(Validator):
alter_table_only = """ALTER TABLE ONLY "Album" ADD CONSTRAINT "FK_AlbumArtistId" FOREIGN KEY ("ArtistId") REFERENCES "Artist" ("ArtistId") ON DELETE NO ACTION ON UPDATE NO ACTION"""
expr = parse_one(alter_table_only)
+ # Checks that user-defined types are parsed into DataType instead of Identifier
+ parse_one("CREATE TABLE t (a udt)").this.expressions[0].args["kind"].assert_is(exp.DataType)
+
self.assertIsInstance(expr, exp.AlterTable)
self.assertEqual(expr.sql(dialect="postgres"), alter_table_only)