Re: SQL Property Graph Queries (SQL/PGQ)

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: assam258(at)gmail(dot)com, Amit Langote <amitlangote09(at)gmail(dot)com>, Junwang Zhao <zhjwpku(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-02-25 11:33:58
Message-ID: 58a32250-58b6-4ca3-9d3d-f396f5f9ed1b@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25.02.26 09:28, Ashutosh Bapat wrote:
>> Thanks for committing those patches. Here's a patchset rebased on top
>> of these commits.
>>
>> 0001 is the same as earlier 0001, but with a conflict in
>> pg_overexplain.sql/.out resolved. It needs 0002 so that a property
>> graph can be used in the GRAPH_TABLE clause.
>> 0002 is your patch to add parserOpenPropGraph() with the typo and
>> comment fixed as mentioned above. It should be squashed into 0001 in
>> the next patchset.
> pg_overexplain failed on CI because of new overexplain fields. Here's
> a patchset fixing the failure by adding those fields to the graph
> table query in pg_overexplain.

Here are some additional patches for fixups and some bug fixes to apply
on top.

Some additional comments:

- In parse_graphtable.c, maybe some of the functions could have more
verbose comments, like what is the input structure, what is the output
structure, what does it check for. Consider for example
transformLabelExpr().

- The structure GraphTableParseState is completely undocumented. Also,
I don't think it belongs into nodes/parsenodes.h. Maybe better in
parser/parse_node.h, where ParseState is also?

- Let's remove the debug elog(INFO) in rewriteGraphTable().

- In some cases in rewriteGraphTable.c(), it's not clear to me whether
the elog should be a user-facing ereport, for example in
generate_queries_for_path_pattern(). Although if there is an invalid
path pattern structure, this should be handled in the parser already?

- Also, check the error message style: no initial capital letter, no
period, "can not" -> "cannot".

- The difference between get_gep_kind_name() and
get_graph_elem_kind_name() is unclear and confusing. Should they be the
same?

Also, for this kind of internal error:

elog(ERROR, "unsupported element pattern kind: \"%s\"",
get_gep_kind_name(gep->kind))

we should just print the raw gep->kind. (If it's unsupported, chances
are that it's not even something that get_gep_kind_name() can translate.)

Attachment Content-Type Size
nocfbot-0001-Add-BEGIN_CATALOG_STRUCT-END_CATALOG_STRUCT.patch text/plain 4.3 KB
nocfbot-0002-Use-LOCKMODE.patch text/plain 911 bytes
nocfbot-0003-Add-missing-quote_identifier-calls-in-ruleutils.c.patch text/plain 3.2 KB
nocfbot-0004-Add-missing-assignment-in-gram.y.patch text/plain 637 bytes
nocfbot-0005-Use-correct-default-privileges-for-property-graphs.patch text/plain 2.2 KB
nocfbot-0006-Record-dependency-of-property-on-collation.patch text/plain 1.1 KB
nocfbot-0007-Check-for-duplicate-alias-in-ALTER-PROPERTY-GRAPH.patch text/plain 3.9 KB
nocfbot-0008-Fix-dumping-of-property-graph-privileges.patch text/plain 2.5 KB
nocfbot-0009-Check-for-A_Star-in-transformGraphTablePropertyRef.patch text/plain 3.1 KB
nocfbot-0010-Add-error-location-and-improve-error-code.patch text/plain 2.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-02-25 11:53:57 Re: [PATCH] Add pg_get_database_ddl() function to reconstruct CREATE DATABASE statement
Previous Message John Naylor 2026-02-25 11:15:49 Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?