Re: sql/json miscellaneous issue
От | Amit Langote |
---|---|
Тема | Re: sql/json miscellaneous issue |
Дата | |
Msg-id | CA+HiwqGbLrR3318s+gk2dkwhz3AnTLPgWvWVFqPjpgGYyZq57w@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: sql/json miscellaneous issue (Stepan Neretin <sncfmgg@gmail.com>) |
Список | pgsql-hackers |
Hi, On Mon, Jun 24, 2024 at 8:02 PM Stepan Neretin <sncfmgg@gmail.com> wrote: > Hi! > > I also noticed a very strange difference in behavior in these two queries, it seems to me that although it returns a stringby default, for the boolean operator it is necessary to return true or false > SELECT * FROM JSON_value (jsonb '1', '$ == "1"' returning jsonb); > json_value > ------------ > > (1 row) > > SELECT * FROM JSON_value (jsonb 'null', '$ == "1"' returning jsonb); > json_value > ------------ > false > (1 row) Hmm, that looks sane to me when comparing the above two queries with their jsonb_path_query() equivalents: select jsonb_path_query(jsonb '1', '$ == "1"'); jsonb_path_query ------------------ null (1 row) select jsonb_path_query(jsonb 'null', '$ == "1"'); jsonb_path_query ------------------ false (1 row) -- Thanks, Amit Langote
В списке pgsql-hackers по дате отправления: