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 1uZPtc-003Jgi-Gd for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jul 2025 08:11:16 +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 1uZPta-00ESZH-Lo for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jul 2025 08:11:15 +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 1uZPta-00ESZ3-7Y for pgsql-hackers@lists.postgresql.org; Wed, 09 Jul 2025 08:11:15 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uZPtZ-006MGy-0b for pgsql-hackers@postgresql.org; Wed, 09 Jul 2025 08:11:13 +0000 Received: by mail-pf1-x442.google.com with SMTP id d2e1a72fcca58-74b56b1d301so2967575b3a.1 for ; Wed, 09 Jul 2025 01:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752048672; x=1752653472; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=y4tHO1L/nBkuI0IADFvZpaBorfYUma0o+Mx1XPbwGP0=; b=I8Bi2b8TBfkPQnXwgaJzLIhZrk9+QzUU2+Uwse7oRAe1rnnLoDmA8MmJp5uPO0br2A nmS8MZrT8oSSlG/ziB1ITGDCp57p0VuYF5gNnq3F3mQMsN+WX7CQkoHxHZwlvd5JE2xi Ni1ihQnwLkKx+pSX/ARSxFXo9f8OE1bz0SGuFurvy3NggCJopo+Jg6Qa5hsJ0k8Qiysf BLvHU81OlzUSnBfOcMFCl2rX69Dlb70kAQBPhzoDy+ZzAXh8he3NCgZIyhmdthFe1lve vFVe0DjY06soG1BY/kDOXppYbuikwKLtZUmk04atTptgm8ficD6rEnf/2qhCbwj8CnQE Hnow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752048672; x=1752653472; h=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=y4tHO1L/nBkuI0IADFvZpaBorfYUma0o+Mx1XPbwGP0=; b=WwM+4cSmTIqv6bxx8I7D/4CJIitWGsjFFaT1AQX9dZSdQKSkrN4/t1PQ29Jv8yfXd3 8EGXDN2OWOJwPAz4P0BQVdEeXJ4Y5q1o1R+8tmXM4KyiykIX+l3iCuVrgn+FWqxtPu6P TYarkdqc55+nCbJyEwlcJ2AdCn99ojdQYu/t9tEq7qqfipwQ8d9gAdn5Fo6h2nBkVIXk FujH8gJ0eX7upje8RKeNpvekdP1FPQR84y1u79uYU7ATRB2SmddkDR1AsOGbQ0pwfpec B4udlPr6+SniD4THtg/+4kQK+iQvK7P31sW85f0JA+blHNp8MK8zHgpnZpzv5LwWFUQU P4Jw== X-Forwarded-Encrypted: i=1; AJvYcCVf1oUY6Kwd7ppNS7jhU67duno/uEO1Ns+W1MF9y660WEEOq/7C2rqOg1JdLrSMnZIunlCAWtrZgdxvvt/G@postgresql.org X-Gm-Message-State: AOJu0YykKlM0vykkSScht6fDxI7Itfc4HcOQEfHnJU1AShDjqYwDYxo+ YGtsnm/WsL6zexdEqgJttn4ZULhGham5vSYGtW+bb6H5ZXMZSOEvhWvq74hIHkr+UvQyQJmjALc ugtb/GRahQ3tSXMjwZvgnWlldNb0RYlw= X-Gm-Gg: ASbGncvoFWL8Mqs7EqO5xoBxcB2uRDPiZXtnho41D7U6nqFRupAaO4aZ6inuZSltiK/ V/P8/blxDZMTyJf21IjZ3rO7Vf7xIR4s5rTbjp6u/1/oDpfC/NBjknSe2vrATBq/jETxnfzTIrx y2Y9yyCh42hUu8QxbyfJCnkbiwU5RUs3frB4xQIMVX8WFjzdaiFIu7vtM= X-Google-Smtp-Source: AGHT+IFqfFLnABxVGsea4/GdqcrLXSeLhJiOhbkbxOR9BpVnFD85giqCv1BBw8ojA2tSvl3CET2S019dQRh32jNMtuM= X-Received: by 2002:a05:6a00:181b:b0:73f:f623:55f8 with SMTP id d2e1a72fcca58-74ea642e0d5mr2274124b3a.5.1752048672329; Wed, 09 Jul 2025 01:11:12 -0700 (PDT) MIME-Version: 1.0 References: <21fa36b4-6d56-4556-b524-9e3955b922c8@eisentraut.org> In-Reply-To: From: Alexandra Wang Date: Wed, 9 Jul 2025 01:10:36 -0700 X-Gm-Features: Ac12FXxTDz9td2T-2wMasoWY2RfDCSIUh6oI3xZUVjc9svJPwbjlGJ-6dZrA4qk Message-ID: Subject: Re: SQL:2023 JSON simplified accessor support To: Jelte Fennema-Nio Cc: Mark Dilger , Matheus Alcantara , Peter Eisentraut , Andrew Dunstan , Nikita Glukhov , PostgreSQL Hackers , "David E. Wheeler" , jian he Content-Type: multipart/alternative; boundary="000000000000be539606397a9e9f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000be539606397a9e9f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Jelte, On Sat, Jun 28, 2025 at 4:52=E2=80=AFPM Jelte Fennema-Nio wrote: > On Thu, 13 Mar 2025 at 15:02, Alexandra Wang > wrote: > > I have attached the new patches. > > Okay I finally found the time to look at this. I created a draft PR > for pg_duckdb[1] to see if I would run into issues. There was only one > real issue I found by doing this. The .* syntax is encoded as NULL in > refupperindexpr, but that is currently already a valid representation > of a slice operation without specifying upper or lower. The easiest > way to reproduce the problem is: > > CREATE TABLE arr(a int[]); > explain (verbose) SELECT a[:] FROM arr; > QUERY PLAN > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > Seq Scan on public.arr (cost=3D0.00..23.60 rows=3D1360 width=3D32) > Output: a.* > > That last line should instead be > Output: a[:] > > So I think we need to add a new Star node type, that represents the * > literal after parsing. > > I haven't looked too closely at the code yet. > Thank you so much for testing and reviewing, I really appreciate it! I fixed the EXPLAIN in v12 by adding a Star node, as you suggested. Looking forward to your thoughts when you have time for a further review! Best, Alex --000000000000be539606397a9e9f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Jelte,

On Sat, Jun 28, 2025 a= t 4:52=E2=80=AFPM Jelte Fennema-Nio <postgres@jeltef.nl> wrote:
On Thu, 13 Mar 2025 at 15:02, Alexandra Wang
<alexa= ndra.wang.oss@gmail.com> wrote:
> I have attached the new patches.

Okay I finally found the time to look at this. I created a draft PR
for pg_duckdb[1] to see if I would run into issues. There was only one
real issue I found by doing this. The .* syntax is encoded as NULL in
refupperindexpr, but that is currently already a valid representation
of a slice operation without specifying upper or lower. The easiest
way to reproduce the problem is:

CREATE TABLE arr(a int[]);
explain (verbose) SELECT a[:] FROM arr;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 QUERY PLAN
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
=C2=A0Seq Scan on public.arr=C2=A0 (cost=3D0.00..23.60 rows=3D1360 width=3D= 32)
=C2=A0 =C2=A0Output: a.*

That last line should instead be
=C2=A0 Output: a[:]

So I think we need to add a new Star node type, that represents the *
literal after parsing.

I haven't looked too closely at the code yet.

=
Thank you so much for testing and reviewing, I really appreciate= it! I
fixed the EXPLAIN in v12 by adding a Star node, as you sug= gested.
Looking forward to your thoughts when you have time for a= further
review!

Best,
Ale= x
--000000000000be539606397a9e9f--