Re: SQL:2023 JSON simplified accessor support

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Alexandra Wang <alexandra(dot)wang(dot)oss(at)gmail(dot)com>, Nikita Glukhov <glukhov(dot)n(dot)a(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Nikita Malakhov <hukutoc(at)gmail(dot)com>, Vik Fearing <vik(at)postgresfriends(dot)org>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Subject: Re: SQL:2023 JSON simplified accessor support
Date: 2025-09-02 05:27:29
Message-ID: 3AB5E620-D210-4061-A5F0-F0B453CF3F4D@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Sep 2, 2025, at 11:53, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> On Monday, September 1, 2025, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com <mailto:li(dot)evan(dot)chao(at)gmail(dot)com>> wrote:
>>
>> The last comment is about error message:
>>
>> ```
>> evantest=# select data.a from test_jsonb_types;
>> ERROR: missing FROM-clause entry for table "data"
>> LINE 1: select data.a from test_jsonb_types;
>> ```
>>
>> “Missing FROM-clause entry” is quite confusing and not providing 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’t think it’s 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 “field” to be a table name if you don’t use the parentheses. This comes up all the time if one uses composite typed columns. I’ll agree this isn’t the greatest error message but I’d suggest starting a new thread if you want to see about improving it.
>
> David J.
>

Sure, we can discuss the topic separately.

--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amul Sul 2025-09-02 07:10:25 Re: Refactoring: Use soft error reporting for *_opt_error functions
Previous Message Zhijie Hou (Fujitsu) 2025-09-02 05:21:11 RE: Avoid retaining conflict-related data when no tables are subscribed