Re: SQL Property Graph Queries (SQL/PGQ)

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Junwang Zhao <zhjwpku(at)gmail(dot)com>
Cc: assam258(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-01-09 15:04:37
Message-ID: CAExHW5seMxDsLT7beuOQ81ssYrT7hAxxpyC5moF-_EsVF-XGPQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 9, 2026 at 10:22 AM Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
>
> Hi Ashutosh,
>
> Here is a brief review of
> v20260102-0001-WIP-SQL-Property-Graph-Queries-SQL-PGQ.patch
>
> + <sect1 id="infoschema-pg-element-table-key-columns">
> + <title><literal>pg_element_table_key_columns</literal></title>
> +
> + <para>
> + The view <literal>pg_element_key_columns</literal> identifies which columns
> + are part of the keys of the element tables of property graphs defined in
> + the current database. Only those property graphs are shown that the
> + current user has access to (by way of being the owner or having some
> + privilege).
> + </para>
>
> pg_element_key_columns should be pg_element_table_key_columns
>

Done.

> + <sect1 id="infoschema-pg-element-table-properties">
> + <title><literal>pg_element_table_properties</literal></title>
> +
> + <para>
> + The view <literal>pg_element_table_labels</literal> shows the definitions
> + of the properties for the element tables of property graphs defined in the
> + current database. Only those property graphs are shown that the current
> + user has access to (by way of being the owner or having some privilege).
> + </para>
>
> pg_element_table_labels here should be pg_element_table_properties, I
> guess this was due to copy-paste.

Done.

>
> + <sect1 id="infoschema-pg-property-graph-privileges">
> + <title><literal>pg_property_graph_privileges</literal></title>
> +
> + <para>
> + The view <literal>property_graph_privileges</literal> identifies all
> + privileges granted on property graphs to a currently enabled role or by a
> + currently enabled role. There is one row for each combination of property
> + graph, grantor, and grantee.
> + </para>
> +
> + <table>
> + <title><structname>property_graph_privileges</structname> Columns</title>
> + <tgroup cols="1">
>
> These two property_graph_privileges should be pg_property_graph_privileges
>

Done.

> + <varlistentry>
> + <term><literal>ADD {VERTEX|NODE|EDGE|RELATIONSHIP} TABLES</literal></term>
> + <listitem>
> + <para>
> + This form adds new vertex or edge tables, using the same syntax as
> + <link linkend="sql-create-property-graph"><command>CREATE PROPERTY
> + GRAPH</command></link>.
> + </para>
> + </listitem>
> + </varlistentry>
> +
> + <varlistentry>
> + <term><literal>DROP {VERTEX|NODE|EDGE|RELATIONSHIP}
> TABLES</literal></term>
> + <listitem>
> + <para>
> + This form removes a vertex or edge table from the property graph.
> + (Only the association of the table with the graph is removed. The table
> + itself is not dropped.)
> + </para>
> + </listitem>
> + </varlistentry>
>
> I think this *drop* action can drop multiple vertex or edge tables, so maybe
> change 'This form removes a vertex or edge table from the property graph' to
> 'This form removes vertex or edge tables from the property graph'. And to
> be consistent, we can also reword 'This form adds new vertex or edge tables'
> to 'This form adds new vertex or edge tables to the property graph'.

Done.

>
> + * operated on. CREATE PROPERTY GROUP and other ALTER PROPERTY GRAPH variants
> + * check all labels.
>
> should be CREATE PROPERTY GRAPH
>

Done.

> + /*
> + * Prepare operands and cast them to the types required by the
> + * equality operator. Similar to PK/FK qauls, referenced vertex key is
> + * used as left operand and referencing edge key is used as right
> + * operand.
> + */
>
> qauls -> quals
>

Done.

Thanks a lot for pointing out these corrections. I have applied them
in my repository. Will be available in the next set of patches.

--
Best Wishes,
Ashutosh Bapat

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-01-09 15:09:35 Re: SQL Property Graph Queries (SQL/PGQ)
Previous Message Greg Sabino Mullane 2026-01-09 14:57:26 Re: PATCH: warn about, and deprecate, clear text passwords