Re: SQL Property Graph Queries (SQL/PGQ)

Vik Fearing <vik@postgresfriends.org>

From: Vik Fearing <vik@postgresfriends.org>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Ajay Pal <ajay.pal.k@gmail.com>
Cc: Imran Zaheer <imran.zhir@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-11-19T16:38:36Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix some typos and make small stylistic improvements

  2. Cleanup users and roles in graph_table_rls test

  3. Dump labels in reproducible order

  4. SQL Property Graph Queries (SQL/PGQ)

  5. Factor out constructSetOpTargetlist() from transformSetOperationTree()

  6. Sort out table_open vs. relation_open in rewriter

  7. Rename grammar nonterminal to simplify reuse

  8. Make ecpg parse.pl more robust with braces

  9. Don't lock partitions pruned by initial pruning

  10. Remove pg_regex_collation

  11. Use auxv to check for CRC32 instructions on ARM.

  12. Fix inappropriate uses of atol()

  13. Remove unnecessary array object_classes[] in dependency.c

On 05/11/2024 16:41, Ashutosh Bapat wrote:
> On Wed, Aug 28, 2024 at 3:48 PM Ashutosh Bapat
> <ashutosh.bapat.oss@gmail.com> wrote:
>> Patches 0001 - 0006 are same as the previous set.
>> 0007 - fixes all the problems you reported till now and also the one I
>> found. The commit message describes the fixes in detail.
> Here's an updated patchset based on the latest HEAD.



I have been looking at this patchset from a user's and standards' 
perspective and I am quite pleased with what I am seeing for the most 
part.  I have not been looking much at the code itself, although I do 
plan on reviewing some of the code in the future.


There are a few things that stick out to me.


1.
I don't see any way to view the structure of of a property graph.  For 
example:


postgres=# CREATE TABLE objects (id INTEGER, color VARCHAR, shape 
VARCHAR, size INTEGER);
CREATE TABLE
postgres=# CREATE PROPERTY GRAPH propgraph VERTEX TABLES (objects KEY 
(id) PROPERTIES ALL COLUMNS);
CREATE PROPERTY GRAPH
postgres=# \dG propgraph
                       List of relations
       Schema       |   Name    | Type      |    Owner
-------------------+-----------+----------------+-------------
  graph_table_tests | propgraph | property graph | vik.fearing
(1 row)

postgres=# \d propgraph
Property graph "graph_table_tests.propgraph"
  Column | Type
--------+------

I don't really know what to do with that.


2.
There is a missing newline in the \? help of psql.
     HELP0("  \\dFt[+] [PATTERN]      list text search templates\n");
     HELP0("  \\dg[S+] [PATTERN]      list roles\n");
     HELP0("  \\dG[S+] [PATTERN]      list property graphs");   <---
     HELP0("  \\di[S+] [PATTERN]      list indexes\n");
     HELP0("  \\dl[+]                 list large objects, same as 
\\lo_list\n");



3.
The noise word "ARE" is missing from the <element table properties 
alternatives>clause.
There is also no support for the EXCEPT clause, but I imagine that can 
be added at a later time.


4.
I notice that tables in pg_catalog are not allowed in a property graph.  
What are the reasons for this?  It is true that this might cause some 
problems with upgrades if a column is removed, but it shouldn't cause 
trouble for columns being added.  That case works with user tables.

5.

The ascii art characters (I am loathe to call them operators) allow junk 
in between them.  For example:


     MATCH (c) -[:lbl]-> (d)

can be written as


     MATCH (c) -
         [:lbl] -
         /* a comment here */
         > (d)


Is that intentional?


----


I will continue to review this feature from the user's perspective.  
Thank you for working on it, I am very excited to get this in.

-- 

Vik Fearing