Re: More new SQL/JSON item methods

Поиск
Список
Период
Сортировка
От Jeevan Chalke
Тема Re: More new SQL/JSON item methods
Дата
Msg-id CAM2+6=Wf=NZqQbsF7fgGoqmcDXtKPR3StgA8_brVVDAXTVjGjw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: More new SQL/JSON item methods  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: More new SQL/JSON item methods  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers


On Thu, Feb 1, 2024 at 7:24 AM Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote:
At Thu, 01 Feb 2024 10:49:57 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in
> By the way, while playing with this feature, I noticed the following
> error message:
>
> > select jsonb_path_query('1.1' , '$.boolean()');
> > ERROR:  numeric argument of jsonpath item method .boolean() is out of range for type boolean
>
> The error message seems a bit off to me. For example, "argument '1.1'
> is invalid for type [bB]oolean" seems more appropriate for this
> specific issue. (I'm not ceratin about our policy on the spelling of
> Boolean..)

Or, following our general convention, it would be spelled as:

'invalid argument for type Boolean: "1.1"'

jsonpath way:

ERROR:  argument of jsonpath item method .boolean() is invalid for type boolean

or, if we add input value, then

ERROR:  argument "1.1" of jsonpath item method .boolean() is invalid for type boolean

And this should work for all the error types, like out of range, not valid, invalid input, etc, etc. Also, we don't need separate error messages for string input as well, which currently has the following form:

"string argument of jsonpath item method .%s() is not a valid representation.."


Thanks


regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center


--
Jeevan Chalke
Principal, Manager
Product Development




edbpostgres.com

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Synchronizing slots from primary to standby
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Make COPY format extendable: Extract COPY TO format implementations