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 1u7dNB-002sqX-Aq for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Apr 2025 16:54:57 +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 1u7dN9-008CGA-GG for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Apr 2025 16:54:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u7dN9-008CFI-5e for pgsql-hackers@lists.postgresql.org; Wed, 23 Apr 2025 16:54:55 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u7dN6-001dJb-2M for pgsql-hackers@postgresql.org; Wed, 23 Apr 2025 16:54:55 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-ac2c7a367d9so1379266b.3 for ; Wed, 23 Apr 2025 09:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745427292; x=1746032092; 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=TvxJR/3mao1qgM9K91Wsdylqd4/i/gr8/JgXY7bhqno=; b=fXSTI9QTyxaqFvM/i20e4RK7vnvRbw+AEcTw/UHzkVPluwr3fps47fTzYZsSCnx/9f H+6C9E3Wvv4s0Wo7B3VfcpKDeDg2RDFNsc73IgXUbCzRj36QajyTcJJ+omoM3KmjyhW5 b7ChmaAeZFgr7DTxDF4y3UV/HoDC4BQPdMKNh77vC9N+M7GyS1WYt7wHM1+brW6emGYB NzXB2QIu9NDEc6Yq5i7b0GBZprl8OLcYwLpclTFPK3QaxbzWIjb6FnVtVDrddlx51itG fRE6AycdkrRfOELMkOmL6LN68pSkoyDCQfAmx54UUNwjcCvYQnPi3TLqCe4sykX7hC3g tOfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745427292; x=1746032092; 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=TvxJR/3mao1qgM9K91Wsdylqd4/i/gr8/JgXY7bhqno=; b=J5EgzjHOfaVd4TZRJIXbJPEBOc3urd5W6qB1U87oawSf6OEJFSqUZqB4DaDq8+b/SS ob5VLOwZaviYa0AVSLXvNe1YUUmepycYI9PdYeFJPMfjO6ZIaWZNRjiBcWYC3kVr1MBM jED5gnbX5wwcJKuSnSN3Jfn3i1rAgCNMHQu9Yh96FhFBFv5aF6SBs9A94bU7zTc7DqbC dimhhhUOrSpQy8uyneQoMTrj/OFPob/+ez/rqXGO0oQYsg94/LtRp8XgcXbNvemCorss bg+1usgSxh+GD5bws6RTP95V0U/YejjCrX0zGJmw/aaT2e3m6LDwuU0oM8l5ihg1CIdm N7DA== X-Forwarded-Encrypted: i=1; AJvYcCVS4EUImbgU0/iXNJMa30W8Lp1SVd3HzeoNsNSRRn3q3aZgu8/Zn80oIucAjorB1Cg0BSZE16ANj2qj+KsD@postgresql.org X-Gm-Message-State: AOJu0YyIfAQvr9Eb0fg8MIR4uu7ZTtROlsPnlqMoyLvy6yioDKGJ5Ejd zbxVUIo7ddu8qG0JTczkKfNEg41BFeZgslAMEr464uCxg6H3TpWhHa2aPbMaGvmxSklsGdbMLt2 NDqe5YSKGra0BXbs3+Xg1ZSWfEvc= X-Gm-Gg: ASbGncsrrhWntVr0+LIlPFraPvCEPVUJ6RlnpXucSw1q9t+f4uyrYIh6NmErNTM0hGi kGaQBUUBsJjP9bXQxDtnjowmQRS+2hZL211IK7KIJgEZF4jZvYTaJNTH9C75/QFOn7lVUYMBzpT UourUKXQBTcYsQFCrADdo= X-Google-Smtp-Source: AGHT+IHJtpyGIJm1u+xi8B3UCsoNQGFCTCf2GBLSnQZSruhj8Qmo0cD9qe3Q6j1Q7J2I4C/30IOJVWl6gglgYOZ2L3A= X-Received: by 2002:a17:907:2dab:b0:ac7:3911:2511 with SMTP id a640c23a62f3a-ace3e033e0cmr117566666b.16.1745427292241; Wed, 23 Apr 2025 09:54:52 -0700 (PDT) MIME-Version: 1.0 References: <21fa36b4-6d56-4556-b524-9e3955b922c8@eisentraut.org> In-Reply-To: From: Nikita Malakhov Date: Wed, 23 Apr 2025 19:54:36 +0300 X-Gm-Features: ATxdqUFpBQ3qHPPJP38MoxlcIlnoJxeWWVMvJOkvEE4d10nahZs8ohvpLvtNIp4 Message-ID: Subject: Re: SQL:2023 JSON simplified accessor support To: Vik Fearing Cc: Alexandra Wang , Mark Dilger , Matheus Alcantara , Peter Eisentraut , Andrew Dunstan , Nikita Glukhov , PostgreSQL Hackers , "David E. Wheeler" , jian he Content-Type: multipart/alternative; boundary="000000000000bc45b2063374f5b5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000bc45b2063374f5b5 Content-Type: text/plain; charset="UTF-8" Hi Alex! Glad you made so much effort to develop this patch set! I think this is an important part of Json functionality. I've looked into you patch and noticed change in behavior in new test results: postgres@postgres=# create table t(x int, y jsonb); insert into t select 1, '{"a": 1, "b": 42}'::jsonb; insert into t select 1, '{"a": 2, "b": {"c": 42}}'::jsonb; insert into t select 1, '{"a": 3, "b": {"c": "42"}, "d":[11, 12]}'::jsonb; CREATE TABLE Time: 6.373 ms INSERT 0 1 Time: 3.299 ms INSERT 0 1 Time: 2.532 ms INSERT 0 1 Time: 2.453 ms Original master: postgres@postgres=# select (t.y).b.c.d.e from t; ERROR: column notation .b applied to type jsonb, which is not a composite type LINE 1: select (t.y).b.c.d.e from t; ^ Time: 0.553 ms Patched (with v11): postgres@postgres=# select (t.y).b.c.d.e from t; e --- (3 rows) Is this correct? -- Regards, Nikita Malakhov Postgres Professional The Russian Postgres Company https://postgrespro.ru/ --000000000000bc45b2063374f5b5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Alex!

Glad you made= so much effort to develop this patch set!
I think this is an imp= ortant part of Json functionality.

I've looked= into you patch and noticed change in behavior
in new test result= s:

postgres@postgres=3D# create table t(x int, y j= sonb);
insert into t select 1, '{"a": 1, "b": 42= }'::jsonb;
insert into t select 1, '{"a": 2, "b&q= uot;: {"c": 42}}'::jsonb;
insert into t select 1, '{&q= uot;a": 3, "b": {"c": "42"}, "d&quo= t;:[11, 12]}'::jsonb;
CREATE TABLE
Time: 6.373 ms
INSERT 0 1Time: 3.299 ms
INSERT 0 1
Time: 2.532 ms
INSERT 0 1
Time: 2.4= 53 ms

Original master:
postgres@postgres= =3D# select (t.y).b.c.d.e from t;
ERROR: =C2=A0column notation .b applie= d to type jsonb, which is not a composite type
LINE 1: select (t.y).b.c.= d.e from t;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^Time: 0.553 ms

Patched (with v11):
post= gres@postgres=3D# select (t.y).b.c.d.e from t;
=C2=A0e
---


(3 rows)

Is this correct?

--
Regards,
Nikita Malakhov
P= ostgres Professional
The Russian Po= stgres Company
--000000000000bc45b2063374f5b5--