Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tbM2h-00A3Nb-Cj for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jan 2025 15:56:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tbM2g-00FaCx-Df for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jan 2025 15:56:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tbM2g-00FaCl-0N for pgsql-hackers@lists.postgresql.org; Fri, 24 Jan 2025 15:56:22 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tbM2d-001I1r-28 for pgsql-hackers@postgresql.org; Fri, 24 Jan 2025 15:56:21 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d41848901bso4603481a12.0 for ; Fri, 24 Jan 2025 07:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737734179; x=1738338979; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TQFo0IIB14pirdpEDg9UviB7XmRHVMQpRyIn/CXE5rQ=; b=J6uaFQ1l62+jLablZDf2NxPBgTXnEGVMlYBj5F0rw4vEhDQEnylpjBjksaGBZ0tyAg n9mLN9/11qYNsdJLlpQnNjkhQI/RfbJIbLmTsOGXgmabfRaObQuAdjlpSQXKchK/4JaF +ahJp8j8YRtsChHyQmWHYgKdvXfiXq5KWqe23qldXyhxRjgcqO+kg8gnq99SxBXHm8L3 TvSxRmn1nOZ5k4eshaMrcaTfcBY09aoPmgYW5VrA6nlYxAw2ea/NpTU9uyPc4QZAnoUK dqPN41TvtGZOqDrr1fNnMWn48VXgAzAMG2JNu7uq4IxvLjHG3CKgCxZ8idQ/GvrFsCTU FG9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737734179; x=1738338979; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TQFo0IIB14pirdpEDg9UviB7XmRHVMQpRyIn/CXE5rQ=; b=MnK92BUAc7cmcqGC10M1DuFIgek8JDRw+Kt/mnrLVD4OueczMwwGz+GB0ZnVZCP+BX UEW44/ytXXHFT8YXQTLvgXDQJHFhRirzu7n38zLuqFJSG5c2UeGDsNO+G1cqfYiUBKDS /ahkhLo8FCPC7k2b3mFi9yUa4T13+MeAGlKiSN9MNO0tLsCas+4k5WSongdYMnZVHfB5 gxHt0eeu2p9zLjYZ/OYXkb/fd4yilzci8F8BVVyeQZcCOCT4qLAFOZNwOJ4ZkwuKHCT5 w9mbFjoBkoH2GlZlqn90GbPxuOcmiIRmARz6crYDcGKJ5lLV8wcgYpvR2VE7wI7vsukE Qjqg== X-Forwarded-Encrypted: i=1; AJvYcCVwL7CL/XUkIJd59BEr1xCnGjM6GXXmWGDnIUkvl1RWQn//rH2z4yMKh6B1CZFqZZVZ9aWXsCzujCKSTfxO@postgresql.org X-Gm-Message-State: AOJu0YziVKrih2WNXQVxuJIowEP2Tl5Y87hX2EmEHNOw4p9UAgWV2zmn xclipoJhVHF+w0rwCcmsO6a1u77BiUXfSnFlhABMSGYDBpyxqbMjSig3fM+ebTgui0kuMuftz3s leZKhPAC4xknDJ/a4J8dCt7BpuYI= X-Gm-Gg: ASbGnctBG3X9LpfhTgK3/MxfMLoNNxbSHEGymYbMHpDBHzB9ycKZpG9dEKqOnpNc/9o u3y+BjWxZV+jj5tAF/EwaaAVaOTvQ74t7GigrCFJnAifxJBKu43syoVTYuliLZ95wAIglx2bGaw iP79xq2I6WdOyknck40J8= X-Google-Smtp-Source: AGHT+IEFHGozFRHTixBIOMCpDvEnXOVrlO0C8a+5OrvN/xOuFSHSqxN/pIPjIpyKLhfRtusDERsgzLTp5Xo6FqIVahw= X-Received: by 2002:a05:6402:4408:b0:5dc:1385:36a with SMTP id 4fb4d7f45d1cf-5dc138506a7mr4887569a12.12.1737734178415; Fri, 24 Jan 2025 07:56:18 -0800 (PST) MIME-Version: 1.0 References: <04c0abe2-e9c5-4ffc-97b2-bedc1e3cd178@eisentraut.org> <3b190de8-910a-4091-82f9-e98cf562d832@postgresfriends.org> In-Reply-To: From: Junwang Zhao Date: Fri, 24 Jan 2025 23:56:06 +0800 X-Gm-Features: AWEUYZkiguh9RuTthp3CBp0Ii-ulE0x0QhPKoYDGlZBhgGjdUijJHrdA9Slbx_M Message-ID: Subject: Re: SQL Property Graph Queries (SQL/PGQ) To: Ashutosh Bapat Cc: Vik Fearing , Ajay Pal , Imran Zaheer , Peter Eisentraut , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 24, 2025 at 11:46=E2=80=AFPM Junwang Zhao w= rote: > > On Fri, Jan 24, 2025 at 9:31=E2=80=AFPM Ashutosh Bapat > wrote: > > > > On Sun, Jan 19, 2025 at 6:45=E2=80=AFPM Junwang Zhao wrote: > > > > > > Hi Ashutosh, > > > > > > On Wed, Jan 1, 2025 at 5:02=E2=80=AFPM Ashutosh Bapat > > > wrote: > > > > > > > > On Wed, Jan 1, 2025 at 2:22=E2=80=AFPM Ashutosh Bapat > > > > wrote: > > > > > > > > > > On Sat, Dec 21, 2024 at 6:21=E2=80=AFPM Junwang Zhao wrote: > > > > > Thanks Junwang for your review. > > > > > > > > > > > Here are some review opinions for 0001, I haven't seen the othe= r > > > > > > patches, forgive me if some of the opinions have already been > > > > > > addressed. > > > > > > > > > > > > 1. In propgraph_edge_get_ref_keys, when finding a matching fore= ign key, > > > > > > the fk pointer will always point to last ForeignKeyCacheInfo of > > > > > > the edge relation, which is wrong. We should add another pointe= r > > > > > > that remembers the matched ForeignKeyCacheInfo to ref_rel. See > > > > > > attached 0001. > > > > > > > > > > Nice catch. I fixed it in a slightly different way reducing overa= ll > > > > > code by using foreach_node(). I have merged this as part of 0004 = which > > > > > has fixes for several other issues. Interestingly there was a SQL= that > > > > > had revealed the problem in create_property_graph.sql. But we had > > > > > accepted a wrong output. Corrected that as well. > > > > > > > > > > > > > > > > > 2. Some of the TODOs seem easy to address, attached 0002 does t= his. > > > > > > > > > > From a cursory glance those changes look useful and mostly correc= t. It > > > > > will be good if you can provide a SQL test for those, covering th= at > > > > > part of the code. Please post the whole patch-set with your chang= es as > > > > > a separate commit/patch. > > > > > > > > > > > > > > > > > 3. Since property name and label name are unique in property gr= aph > > > > > > scope, some of the wording are not accurate. See attached 0003. > > > > > > > > > > > > > > > - For each property graph element, all properties with the s= ame name must > > > > > - have the same expression for each label. For example, thi= s would be > > > > > + For each property graph, all properties with the same name= must > > > > > + have the same expression. For example, this would be > > > > > > > > > > Each property graph element may have a property with the same nam= e > > > > > associated with multiple labels. But each of those properties sho= uld > > > > > have the same expression. You may see that as the same property b= eing > > > > > defined multiple times once in each label it is associated with O= R > > > > > multiple properties with the same name. Current wording uses the > > > > > latter notion, so it looks fine to me. The changes made to error > > > > > messages are not needed with this notion. > > > > > > > > My last email is held for moderation. It will arrive once moderator= s > > > > release it. In the meantime trying to send the patches as a zip fil= e > > > > in a hope that it won't require moderation. > > > > > > > > -- > > > > Best Wishes, > > > > Ashutosh Bapat > > > > > > 0007-RLS-tests-20250101.patch introduces regression test failure: > > > > > > +WARNING: outfuncs/readfuncs failed to produce an equal rewritten pa= rse tree > > > > > > P.S. It seems the patch set doesn't apply to master. > > > > Thanks for noticing it. > > > > Here's rebased patch set on the current head with some minor conflicts > > in various files fixed. I did not see the said failure on my laptop. > > I figured out it's because I have `-DWRITE_READ_PARSE_PLAN_TREES` this op= tion, > removing this option clears the warning, but I'm not sure if this is a > hidden issue. Cirrus meson FreeBSD build has this setting, the regression test rowsecurity failed the same as my local machine, see [0], so I think this is an issue we have to resolve. Cirrus meson Bookworm build failed 002_pg_upgrade.pl and 027_stream_regress= .pl, see [1] [0] https://cirrus-ci.com/task/5702052891852800 [1] https://cirrus-ci.com/task/6265002845274112 > > > > > 0001-0009 patches are the same as the previous set sans mergeconflict f= ixes. > > 0010 - is test for \dGx - to make sure that the extended format output > > works with \dG. We may decide not to have this patch in the final > > commit. But no harm in being there til that point. > > I have some changes based on the latest patch set. I attached two patches= with > the following summary. > > 0001: > - doc: some of the query in ddl.sgml can not be executed > - after path factor was introduced, some comments doesn't apply > > 0002: > - add a get_propgraph_element_alias_name function and do some trivial ref= actor > > > -- > > Best Wishes, > > Ashutosh Bapat > > > > -- > Regards > Junwang Zhao --=20 Regards Junwang Zhao