Re: SQL:2023 JSON simplified accessor support - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: SQL:2023 JSON simplified accessor support
Date
Msg-id CAKFQuwZ7BE+QNuN3PLxLioJQ0fqn0jdLqSme6bsbhCGeGmtuhQ@mail.gmail.com
Whole thread Raw
In response to Re: SQL:2023 JSON simplified accessor support  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: SQL:2023 JSON simplified accessor support
List pgsql-hackers
On Monday, September 1, 2025, Chao Li <li.evan.chao@gmail.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.

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: SQL:2023 JSON simplified accessor support
Next
From: Michael Paquier
Date:
Subject: Re: Refactoring: Use soft error reporting for *_opt_error functions