Hi,

The SELECT queries using GRAPH_TABLE in ddl.sgml and queries.sgml
were written on single long lines, requiring horizontal scrolling.

This patch breaks the queries across multiple lines to improve
readability.  This is also consistent with the CREATE PROPERTY GRAPH
statement in the PostgreSQL documentation, which is already formatted
across multiple lines:

https://www.postgresql.org/docs/19/ddl-property-graphs.html

For the placement and indentation of the line breaks in the
GRAPH_TABLE queries, I referred to the example in the "Property Graph
Queries" section of Peter Eisentraut's SQL:2023 overview:

https://peter.eisentraut.org/blog/2023/04/04/sql-2023-is-finished-here-is-whats-new

The example is formatted as follows:

SELECT owner_name,
       SUM(amount) AS total_transacted
FROM financial_transactions GRAPH_TABLE (
  MATCH (p:person WHERE p.name = 'Alice')
        -[:ownerof]-> (:account)
        -[t:transaction]- (:account)
        <-[:ownerof]- (owner:person|company)
  COLUMNS (owner.name AS owner_name, t.amount AS amount)
) AS ft
GROUP BY owner_name;

Best regards,
Taiki Koshino

Taiki Koshino<[email protected]>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/

Attachment: v1-0001-doc-Reformat-SELECT-queries-using-GRAPH_TABLE.patch
Description: v1-0001-doc-Reformat-SELECT-queries-using-GRAPH_TABLE.patch

Reply via email to