v14-0010-dG-tests-and-improvements.patch

application/octet-stream

Filename: v14-0010-dG-tests-and-improvements.patch
Type: application/octet-stream
Part: 5
Message: Re: SQL Property Graph Queries (SQL/PGQ)

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v14-0010
Subject: \dG tests and improvements
File+
src/bin/psql/describe.c 1 0
src/test/regress/expected/create_property_graph.out 9 1
src/test/regress/sql/create_property_graph.sql 1 0
From 614d94a6b942b474f2aaceb01fa0dd5d86f0e112 Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: Fri, 24 Jan 2025 18:15:46 +0530
Subject: [PATCH v14 10/15] \dG tests and improvements

Commit 00f4c2959d631c7851da21a512885d1deab28649 added support to use
expanded mode to all list meta-commands. This commit adds a test to make
sure that the support also works for new metacommand \dG added to list
property graphs.

a14707da564e8c94bd123f0e3a75e194fd7ef56a introduced relation specific
headers in describe output. Adjust it for property graphs.

Ashutosh Bapat
---
 src/bin/psql/describe.c                             |  1 +
 src/test/regress/expected/create_property_graph.out | 10 +++++++++-
 src/test/regress/sql/create_property_graph.sql      |  1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 3fd55d0435e..51c3cba3bfc 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4291,6 +4291,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys
 			(showMatViews) ? _("List of materialized views") :
 			(showSeq) ? _("List of sequences") :
 			(showForeign) ? _("List of foreign tables") :
+			(showPropGraphs) ? _("List of property graphs") :
 			"List of ???";		/* should not get here */
 		myopt.translate_header = true;
 		myopt.translate_columns = translate_columns;
diff --git a/src/test/regress/expected/create_property_graph.out b/src/test/regress/expected/create_property_graph.out
index 824695358f8..c561b1db75b 100644
--- a/src/test/regress/expected/create_property_graph.out
+++ b/src/test/regress/expected/create_property_graph.out
@@ -645,12 +645,20 @@ SELECT pg_get_propgraphdef('pg_type'::regclass);  -- error
 ERROR:  "pg_type" is not a property graph
 \a\t
 \dG g1
-                             List of relations
+                          List of property graphs
            Schema            | Name |      Type      |        Owner        
 -----------------------------+------+----------------+---------------------
  create_property_graph_tests | g1   | property graph | regress_graph_user1
 (1 row)
 
+\dGx g1
+List of property graphs
+-[ RECORD 1 ]-----------------------
+Schema | create_property_graph_tests
+Name   | g1
+Type   | property graph
+Owner  | regress_graph_user1
+
 -- TODO
 \d g1
 Property graph "create_property_graph_tests.g1"
diff --git a/src/test/regress/sql/create_property_graph.sql b/src/test/regress/sql/create_property_graph.sql
index 9a1fe4fc6de..1e309b9f935 100644
--- a/src/test/regress/sql/create_property_graph.sql
+++ b/src/test/regress/sql/create_property_graph.sql
@@ -248,6 +248,7 @@ SELECT pg_get_propgraphdef('pg_type'::regclass);  -- error
 \a\t
 
 \dG g1
+\dGx g1
 
 -- TODO
 \d g1
-- 
2.39.5