From 0752cb10b24886323fbaba062f9616dcf75db005 Mon Sep 17 00:00:00 2001 From: Ashutosh Bapat Date: Thu, 18 Dec 2025 10:27:37 +0530 Subject: [PATCH v20251218 2/3] create_property_graph test changes 1. More typmod mismatch test queries testing typmod mismatch in property expressions. 2. Remove "TODO: dubious error message" comment. The error does not look dubious. It's correctly pointing out that an edge depends upon the vertex table being dropped. --- .../regress/expected/create_property_graph.out | 15 ++++++++++++++- src/test/regress/sql/create_property_graph.sql | 13 ++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out index 0e21600e8d7..ef6c776854b 100644 --- a/src/test/regress/expected/create_property_graph.out +++ b/src/test/regress/expected/create_property_graph.out @@ -55,7 +55,7 @@ ALTER PROPERTY GRAPH g3 ALTER PROPERTY GRAPH g3 ALTER VERTEX TABLE t3 DROP LABEL t3l3x; -- error ERROR: property graph "g3" element "t3" has no label "t3l3x" ALTER PROPERTY GRAPH g3 ALTER VERTEX TABLE t3 DROP LABEL t3l3; -ALTER PROPERTY GRAPH g3 DROP VERTEX TABLES (t2); -- fail (TODO: dubious error message) +ALTER PROPERTY GRAPH g3 DROP VERTEX TABLES (t2); -- fail ERROR: cannot drop vertex t2 of property graph g3 because other objects depend on it DETAIL: edge e1 of property graph g3 depends on vertex t2 of property graph g3 HINT: Use DROP ... CASCADE to drop the dependent objects too. @@ -171,6 +171,19 @@ CREATE PROPERTY GRAPH gx ); ERROR: property "p1" data type mismatch: character varying(10) vs. character varying(15) DETAIL: In a property graph, a property of the same name has to have the same data type in each label. +CREATE PROPERTY GRAPH gx + VERTEX TABLES ( + t1x KEY (a) PROPERTIES (b::varchar(20) AS p1), + t2x KEY (i) PROPERTIES (j::varchar(25) AS p1) -- typmod mismatch + ); +ERROR: property "p1" data type mismatch: character varying(20) vs. character varying(25) +DETAIL: In a property graph, a property of the same name has to have the same data type in each label. +CREATE PROPERTY GRAPH gx + VERTEX TABLES ( + t1x KEY (a) PROPERTIES (b::varchar(20) AS p1), + t2x KEY (i) PROPERTIES (j::varchar(20) AS p1) -- matching typmods by casting works + ); +DROP PROPERTY GRAPH gx; DROP TABLE t1x, t2x; CREATE PROPERTY GRAPH gx VERTEX TABLES ( diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql index ab73e340cc3..a6bec4a5c1a 100644 --- a/src/test/regress/sql/create_property_graph.sql +++ b/src/test/regress/sql/create_property_graph.sql @@ -50,7 +50,7 @@ ALTER PROPERTY GRAPH g3 ADD LABEL t3l3 PROPERTIES ALL COLUMNS; ALTER PROPERTY GRAPH g3 ALTER VERTEX TABLE t3 DROP LABEL t3l3x; -- error ALTER PROPERTY GRAPH g3 ALTER VERTEX TABLE t3 DROP LABEL t3l3; -ALTER PROPERTY GRAPH g3 DROP VERTEX TABLES (t2); -- fail (TODO: dubious error message) +ALTER PROPERTY GRAPH g3 DROP VERTEX TABLES (t2); -- fail ALTER PROPERTY GRAPH g3 DROP VERTEX TABLES (t2) CASCADE; ALTER PROPERTY GRAPH g3 DROP EDGE TABLES (e2); @@ -133,6 +133,17 @@ CREATE PROPERTY GRAPH gx t1x KEY (a) PROPERTIES (b AS p1), t2x KEY (i) PROPERTIES (j AS p1) -- typmod mismatch ); +CREATE PROPERTY GRAPH gx + VERTEX TABLES ( + t1x KEY (a) PROPERTIES (b::varchar(20) AS p1), + t2x KEY (i) PROPERTIES (j::varchar(25) AS p1) -- typmod mismatch + ); +CREATE PROPERTY GRAPH gx + VERTEX TABLES ( + t1x KEY (a) PROPERTIES (b::varchar(20) AS p1), + t2x KEY (i) PROPERTIES (j::varchar(20) AS p1) -- matching typmods by casting works + ); +DROP PROPERTY GRAPH gx; DROP TABLE t1x, t2x; CREATE PROPERTY GRAPH gx -- 2.34.1