From 9d0d6002c391d47f315b91da577e30ac2ce1ddfc Mon Sep 17 00:00:00 2001
From: Taiki Koshino <koshio@sraoss.co.jp>
Date: Thu, 20 Aug 2026 09:15:24 +0900
Subject: [PATCH v5] doc: Reformat SELECT queries using GRAPH_TABLE

The SELECT queries using GRAPH_TABLE in ddl.sgml and queries.sgml
were written on single long lines, requiring horizontal scrolling.
Break the queries across multiple lines to improve readability.
---
 doc/src/sgml/ddl.sgml     | 12 +++++++++---
 doc/src/sgml/queries.sgml | 13 +++++++++----
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 160f4eebb35..d57e1a4b9b3 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -5824,7 +5824,9 @@ CREATE PROPERTY GRAPH myshop
    This graph could then be queried like this:
 <programlisting>
 -- get list of customers active today
-SELECT customer_name FROM GRAPH_TABLE (myshop MATCH (c IS customers)-[IS customer_orders]->(o IS orders WHERE o.ordered_when = current_date) COLUMNS (c.name AS customer_name));
+SELECT customer_name FROM GRAPH_TABLE (myshop
+    MATCH (c IS customers)-[IS customer_orders]->(o IS orders WHERE o.ordered_when = current_date)
+    COLUMNS (c.name AS customer_name));
 </programlisting>
    corresponding approximately to this relational query:
 <programlisting>
@@ -5888,7 +5890,9 @@ CREATE PROPERTY GRAPH myshop
   <para>
    With this definition, we can write a query like this:
 <programlisting>
-SELECT customer_name FROM GRAPH_TABLE (myshop MATCH (c IS customer)-[IS has_placed]->(o IS "order" WHERE o.ordered_when = current_date) COLUMNS (c.name AS customer_name));
+SELECT customer_name FROM GRAPH_TABLE (myshop
+    MATCH (c IS customer)-[IS has_placed]->(o IS "order" WHERE o.ordered_when = current_date)
+    COLUMNS (c.name AS customer_name));
 </programlisting>
    With the new labels the <literal>MATCH</literal> clause is now more intuitive.
   </para>
@@ -5927,7 +5931,9 @@ CREATE PROPERTY GRAPH myshop
    <literal>employees</literal> table to something, but it is allowed like
    this.)  Then we can run a query like this (incomplete):
 <programlisting>
-SELECT ... FROM GRAPH_TABLE (myshop MATCH (IS person WHERE name = '...')-[]->... COLUMNS (...));
+SELECT ... FROM GRAPH_TABLE (myshop
+    MATCH (IS person WHERE name = '...')-[]->...
+    COLUMNS (...));
 </programlisting>
    This would automatically consider both the <literal>customers</literal> and
    the <literal>employees</literal> tables when looking for an edge with the
diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml
index 3d729f983b5..bd1497ff80d 100644
--- a/doc/src/sgml/queries.sgml
+++ b/doc/src/sgml/queries.sgml
@@ -2768,7 +2768,9 @@ SELECT * FROM t;
     Consider this example from <xref linkend="ddl-property-graphs"/>:
 <programlisting>
 -- get list of customers active today
-SELECT customer_name FROM GRAPH_TABLE (myshop MATCH (c IS customers)-[IS customer_orders]->(o IS orders WHERE o.ordered_when = current_date) COLUMNS (c.name AS customer_name));
+SELECT customer_name FROM GRAPH_TABLE (myshop
+    MATCH (c IS customers)-[IS customer_orders]->(o IS orders WHERE o.ordered_when = current_date)
+    COLUMNS (c.name AS customer_name));
 </programlisting>
     The graph query part happens inside the <literal>GRAPH_TABLE</literal>
     construct.  As far as the rest of the query is concerned, this acts like a
@@ -2777,7 +2779,9 @@ SELECT customer_name FROM GRAPH_TABLE (myshop MATCH (c IS customers)-[IS custome
     names can be assigned to the result, and the result can be joined with
     other tables, subsequently filtered, and so on, for example:
 <programlisting>
-SELECT ... FROM GRAPH_TABLE (mygraph MATCH ... COLUMNS (...)) AS myresult (a, b, c) JOIN othertable USING (a) WHERE b > 0 ORDER BY c;
+SELECT ... FROM GRAPH_TABLE (mygraph
+    MATCH ...
+    COLUMNS (...)) AS myresult (a, b, c) JOIN othertable USING (a) WHERE b > 0 ORDER BY c;
 </programlisting>
    </para>
 
@@ -2893,8 +2897,9 @@ SELECT ... FROM GRAPH_TABLE (mygraph MATCH ... COLUMNS (...)) AS myresult (a, b,
     For example (assuming appropriate definitions of the property graph as
     well as the underlying tables):
 <programlisting>
-GRAPH_TABLE (mygraph MATCH (p IS person)-[h IS has]->(a IS account)
-             COLUMNS (p.name AS person_name, h.since AS has_account_since, a.num AS account_number)
+GRAPH_TABLE (mygraph
+    MATCH (p IS person)-[h IS has]->(a IS account)
+    COLUMNS (p.name AS person_name, h.since AS has_account_since, a.num AS account_number))
 </programlisting>
     <literal>WHERE</literal> clauses can be used inside element patterns to
     filter matches:
-- 
2.52.0

