Hi Junwang,

On Mon, Nov 24, 2025 at 8:01 AM Junwang Zhao <[email protected]> wrote:
>
> Hi Ashutosh,
>
> On Thu, Nov 20, 2025 at 11:01 PM Ashutosh Bapat
> <[email protected]> wrote:
> >
> > Hi Junwang,
> >
> > On Sun, Aug 31, 2025 at 4:35 PM Junwang Zhao <[email protected]> wrote:
> > >
> > >
> > > I have some review comments, and hope some of them are helpful.
> > >
> > > 1.
> > >
> > > doc/src/sgml/ddl.sgml
> > >
> > > +<programlisting>
> > > +CREATE PROPERTY GRAPH myshop
> > > +    VERTEX TABLES (
> > > +        products LABEL product,
> > > +        customers LABEL customer,
> > > +        orders LABEL order
> > > +    )
> > > +    EDGE TABLES (
> > > +        order_items SOURCE orders DESTINATION products LABEL contains,
> > > +        customer_orders SOURCE customers DESTINATION orders LABEL has
> > > +    );
> > > +</programlisting>
> > >
> > > order is a reserved keyword, so the following example will fail, we
> > > should not give a wrong example in our document.
> > >
> >
> > I tried those examples and they all worked. What error are you
> > getting? What is not working for you?
>
> Here is what I got, pay attention to the queries with singular `order`, it's a
> reserved keyword.

I see it now. Sorry for missing it earlier.

I think something like attached should fix the problem, if we want to
continue with the current example. FWIW, it demos that quotes can be
used with labels, but we don't necessarily do that with other objects.
I am not sure whether Peter would like to continue with the example or
use a different one avoiding this subtlety altogether. Hence not
including it in the overall patchset.


-- 
Best Wishes,
Ashutosh Bapat
commit 3c4fd64d1f92172e28143eea81c8f6edb3d173cf
Author: Ashutosh Bapat <[email protected]>
Date:   Mon Nov 24 10:22:23 2025 +0530

    Quote keyword "order" in property graph examples
    
    The example, as is, gives a syntax error. But quoting the keyword "order" 
fixes
    the syntax error.
    
    Peter, who wrote the example, may decide to change the example to avoid this
    subtelity altogether. Hence didn't merge it with the first commit.
    
    Author: Ashutosh Bapat
    Reported-by: Junwang Zhou

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index cdee8eaa39b..a05458a1a4a 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -5810,7 +5810,7 @@ CREATE PROPERTY GRAPH myshop
     VERTEX TABLES (
         products LABEL product,
         customers LABEL customer,
-        orders LABEL order
+        orders LABEL "order"
     )
     EDGE TABLES (
         order_items SOURCE orders DESTINATION products LABEL contains,
@@ -5822,12 +5822,17 @@ CREATE PROPERTY GRAPH myshop
   <para>
    With this definition, we can write a query like this:
 <programlisting>
-SELECT customer_name FROM GRAPH_TABLE (myshop MATCH 
(c:customer)-[:has]->(o:order WHERE o.ordered_when = current_date) COLUMNS 
(c.name AS customer_name));
+SELECT customer_name FROM GRAPH_TABLE (myshop MATCH 
(c:customer)-[:has]->(o:"order" WHERE o.ordered_when = current_date) COLUMNS 
(c.name AS customer_name));
 </programlisting>
    With the new labels and using the colon instead of <literal>IS</literal>,
    which are equivalent, the <literal>MATCH</literal> clause is now more
    compact and intuitive.
   </para>
+  <para>
+   Please notice that label <literal>order</literal> is quoted. If we run above
+   statements without adding quotes around <literal>order</literal>, we will 
get
+   a syntax error since <literal>order</literal> is a keyword.
+  </para>
 
   <para>
    Another use is to apply the same label to multiple element tables.  For

Reply via email to