Re: SQL Property Graph Queries (SQL/PGQ)

From: Junwang Zhao <zhjwpku(at)gmail(dot)com>
To: assam258(at)gmail(dot)com
Cc: zengman <zengman(at)halodbtech(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Amit Langote <amitlangote09(at)gmail(dot)com>, Vik Fearing <vik(at)postgresfriends(dot)org>, Ajay Pal <ajay(dot)pal(dot)k(at)gmail(dot)com>, Imran Zaheer <imran(dot)zhir(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL Property Graph Queries (SQL/PGQ)
Date: 2026-03-18 15:58:07
Message-ID: CAEG8a3JyhoNWOh4KYMeitMCCrc76v9bpOoKv0AT0mxx+0c6RGg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 18, 2026 at 10:47 PM Henson Choi <assam258(at)gmail(dot)com> wrote:
>
> Hi Junwang,
>
>> >> Yeah, I noticed that too, I will compose a patch for further review.
>> >
>> >
>> > Great, looking forward to reviewing it.
>>
>> Here.
>
>
> Thanks for the patch. The code changes look correct and match the
> standard's scoping semantics (SR 18).
>
> I applied the patch and ran the regression tests — all clean.
>
> A couple of minor items:
>
> 1. pgindent alignment
>
> The variable declaration on this line doesn't follow PostgreSQL's
> tab-aligned style:
>
> String *v = makeString(pstrdup(gep->variable));
>
> Should be:
>
> String *v = makeString(pstrdup(gep->variable));
>
> Running pgindent on the file should fix this automatically.

fixed.

>
> 2. Additional test coverage for edge patterns
>
> The current tests cover vertex-to-vertex cross-references well.
> How about adding a case where an edge WHERE clause references
> vertex variables? For example:
>
> -- edge WHERE cross-referencing vertex and edge properties
> SELECT *
> FROM GRAPH_TABLE (mygraph
> MATCH (a)-[e WHERE e.weight > a.score]->(b)
> COLUMNS (a.name AS a_name, e.weight AS e_wt,
> b.name AS b_name)
> ) ORDER BY 1, 2;
>
> This would ensure the fix covers edge element patterns too, not
> just vertex patterns.

I created a similar case using the social graph, applying a pattern
*a followed b before a's 18th birthday*, which should work.

>
> Otherwise, LGTM.
>
> Regards,
> Henson
>

--
Regards
Junwang Zhao

Attachment Content-Type Size
v2-0001-GRAPH_TABLE-collect-variables-across-full-clause.patch application/octet-stream 8.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-03-18 16:01:06 Re: SQL Property Graph Queries (SQL/PGQ)
Previous Message Nazir Bilal Yavuz 2026-03-18 15:50:20 Re: Enable -Wstrict-prototypes and -Wold-style-definition by default