doc: Reformat SELECT queries using GRAPH_TABLE - Mailing list pgsql-hackers

From Koshino Taiki
Subject doc: Reformat SELECT queries using GRAPH_TABLE
Date
Msg-id OS9P286MB64860BD6CD6D4B4B0E1CEDE894A32@OS9P286MB6486.JPNP286.PROD.OUTLOOK.COM
Whole thread
Responses Re: Proposal: Conflict log history table for Logical Replication
Re: doc: Reformat SELECT queries using GRAPH_TABLE
List pgsql-hackers
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<koshino@sraoss.co.jp>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Fix small psql slash option leaks
Next
From: Michael Paquier
Date:
Subject: Re: use of SPI by postgresImportForeignStatistics