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 1utI5T-004Flm-Uu for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Sep 2025 03:53:41 +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 1utI5R-001qcg-RR for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Sep 2025 03:53:38 +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 1utI5R-001qcV-Bk for pgsql-hackers@lists.postgresql.org; Tue, 02 Sep 2025 03:53:37 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1utI5P-00064X-2U for pgsql-hackers@postgresql.org; Tue, 02 Sep 2025 03:53:36 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-74381e2079fso4018439a34.0 for ; Mon, 01 Sep 2025 20:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756785215; x=1757390015; darn=postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xuVWKybraGUf7AhR2jXb0KKK3pNFhCHXIQcM3AuCPLk=; b=GlojRLgg8mat5C8+vm0//uiIIuFMGNirysjtq5/ANg6FYaREL/8TYAVGkbXeUqd3C7 K8uzOmOk0tsWWSEoyj3CVcUJqr7E9PgzrcgNencjyv7A+c2NyeKB1oH+UO1lpdHAi4Hd /EcSEDhsDX6mehqbYMDjGYUVnmC4xlkg0A+vcRkcRJQKz2JSUNg/naibJ7B9doR5+LDz ekbGeWCzMZQCFbXcBEWolNnqGrN28U3S5R+MhO7JfwmGZAy7AZXwhygZwGdUaEiW3029 tQGwDKZoB+jOGDZqC/4RWT70ni8/Ay3np3NYnS+mgIHZl3PHNoSpz3Tq8JG0rp7mKkWs aR5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756785215; x=1757390015; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xuVWKybraGUf7AhR2jXb0KKK3pNFhCHXIQcM3AuCPLk=; b=dlffq2cO8Gr9G5yYuH1j1mTRJjY5boVe4FoY0/pBZrZDi4nWbzWPk6DKqmW277Mrpf QQuXbTifQjad9K6w3WSnunj7UfOqgdYJVqpRuM2GKIHgtohbG9r7X8MwpbDYtPOpko8g 5P1NCcXMZ3kpQPd6nrcPjRzTBPSiNbAEjjEClMMFY9X/hG7/nQxudVGxzDGkrbiv5xAd NspZdk8TKwmur9djan7I0w6FbQq8swrhwAawKq21rMyw8mCK53hMIhfiHUHjvBtjgRE5 AAFFPcgXPZLZe4XJWxR1VElVfB4vIjXbCzCZclq+63aocEGj7Zj0q1Z1XaaVRbrgU0+5 iJaQ== X-Forwarded-Encrypted: i=1; AJvYcCVdshi2AuPc4xCVic79/N5aebqRVyJTu1djdiCphdCOIXzU+7YuO682pZC5D2nwoyEGELIDWCP2jjAPYDYu@postgresql.org X-Gm-Message-State: AOJu0YzcEUGqSB+aUxre+qW76YMYGKfgm3Zh3wbqV9mALXW5vrETFNxe Cz7H0l4d71fsUo+7enJ3VM/YNyTKN7ru4K0u6/LlSdwObaI8Rv5MPq8inj/uTyLBWNnuKu4v6Dg DiOywFcfznlMnw4kI2wUAwP1XAW+HJe0= X-Gm-Gg: ASbGnctEMHgsZtr7nKwNiluJEw0Fr0A6IUsL8ij56Sl8ElTYjBUyGjPKHDtS+Bw7xFM 9YX6jJAnQD/fq1sCQNMtt36PAqo0KYYlWI0ajvw+gMD409sDHOZDGscrbqw49bDQRAYSQCkCxNt agSVXIYa/6AVMUDALM78F/5HKfZuR3Ykq7YP+aJtrL7xzkUmMg9dVaR/gKOsJKs9R/6/e21ArzQ fLo3x9S7dUnnLcNImO20RnL7wyVo7HpH+adnVVFw5aWa6yWmlE= X-Google-Smtp-Source: AGHT+IGNuH8Tb62dcqjYzATsnPsINrzyIIhFuZrbS7BIyAYyqILM9o79XEuJkYaVajwOF0thiCIuIjc/pISqKVwO8Mw= X-Received: by 2002:a05:6830:7010:b0:741:5d00:e86a with SMTP id 46e09a7af769-74569dbdce6mr5181891a34.8.1756785214887; Mon, 01 Sep 2025 20:53:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6802:1d88:10b0:5df:b5f6:b71 with HTTP; Mon, 1 Sep 2025 20:53:34 -0700 (PDT) In-Reply-To: References: <21fa36b4-6d56-4556-b524-9e3955b922c8@eisentraut.org> <290418A2-3A9B-4304-AAAD-4A40CFF1CB93@gmail.com> <98C6F445-773B-4C82-8198-7F5CD56D5252@gmail.com> From: "David G. Johnston" Date: Mon, 1 Sep 2025 20:53:34 -0700 X-Gm-Features: Ac12FXzro63elS9A8VxVwGEW13yw48iXrvjO0gTI3Uwewz5z4FrDS42AdDajWbU Message-ID: Subject: Re: SQL:2023 JSON simplified accessor support To: Chao Li Cc: Alexandra Wang , Nikita Glukhov , jian he , Nikita Malakhov , Vik Fearing , Mark Dilger , Matheus Alcantara , Peter Eisentraut , Andrew Dunstan , PostgreSQL Hackers , "David E. Wheeler" Content-Type: multipart/alternative; boundary="000000000000ae1c47063dc96e05" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ae1c47063dc96e05 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, September 1, 2025, Chao Li wrote: > > The last comment is about error message: > > ``` > evantest=3D# select data.a from test_jsonb_types; > ERROR: missing FROM-clause entry for table "data" > LINE 1: select data.a from test_jsonb_types; > ``` > > =E2=80=9CMissing FROM-clause entry=E2=80=9D is quite confusing and not pr= oviding much > useful hint to resolve the problem. When I first saw this error, I was > stuck. Only after read through the commit comments, I figured out the > problem. For end users, we should provide some more meaningful error > messages. > > I don=E2=80=99t think it=E2=80=99s fair to blame this patch set for this. = If you want to reference a component of a composite column you need to write ([tbl.]col).field otherwise the parser gets confused because it wants the thing prior to =E2=80=9Cfield=E2=80=9D to be a table name if you don=E2=80= =99t use the parentheses. This comes up all the time if one uses composite typed columns. I=E2=80=99ll agree this isn=E2=80=99t the greatest error message = but I=E2=80=99d suggest starting a new thread if you want to see about improving it. David J. --000000000000ae1c47063dc96e05 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, September 1, 2025, Chao Li <li.evan.chao@gmail.com> wrote:

The last comment= is about error message:

```
evante= st=3D# select data.a from test_jsonb_types;
ERROR: =C2=A0missing = FROM-clause entry for table "data"
LINE 1: select data.= a from test_jsonb_types;
```

=E2= =80=9CMissing FROM-clause entry=E2=80=9D is quite confusing and not providi= ng much useful hint to resolve the problem. When I first saw this error, I = was stuck. Only after read through the commit comments, I figured out the p= roblem. For end users, we should provide some more meaningful error message= s.


I don=E2=80= =99t think it=E2=80=99s fair to blame this patch set for this.=C2=A0 If you= want to reference a component of a composite column you need to write ([tb= l.]col).field otherwise the parser gets confused because it wants the thing= prior to =E2=80=9Cfield=E2=80=9D to be a table name if you don=E2=80=99t u= se the parentheses.=C2=A0 This comes up all the time if one uses composite = typed columns.=C2=A0 I=E2=80=99ll agree this isn=E2=80=99t the greatest err= or message but I=E2=80=99d suggest starting a new thread if you want to see= about improving it.

David J.

--000000000000ae1c47063dc96e05--