Re: sql/json miscellaneous issue

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: sql/json miscellaneous issue
Дата
Msg-id CA+HiwqF3Zq3iJoXCyS3uwb8ydELYuyT1WHOw=2TepYKnBp5NBg@mail.gmail.com
обсуждение исходный текст
Ответ на sql/json miscellaneous issue  (jian he <jian.universality@gmail.com>)
Ответы Re: sql/json miscellaneous issue
Список pgsql-hackers
Hi,

On Mon, Jun 24, 2024 at 7:04 PM jian he <jian.universality@gmail.com> wrote:
>
> hi.
> the following two queries should return the same result?
>
> SELECT * FROM JSON_query (jsonb 'null', '$' returning jsonb);
> SELECT * FROM JSON_value (jsonb 'null', '$' returning jsonb);

I get this with HEAD:

SELECT * FROM JSON_query (jsonb 'null', '$' returning jsonb);
 json_query
------------
 null
(1 row)

Time: 734.587 ms
SELECT * FROM JSON_value (jsonb 'null', '$' returning jsonb);
 json_value
------------

(1 row)

Much like:

SELECT JSON_QUERY('{"key": null}', '$.key');
 json_query
------------
 null
(1 row)

Time: 2.975 ms
SELECT JSON_VALUE('{"key": null}', '$.key');
 json_value
------------

(1 row)

Which makes sense to me, because JSON_QUERY() is supposed to return a
JSON null in both cases and JSON_VALUE() is supposed to return a SQL
NULL for a JSON null.

--
Thanks, Amit Langote



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

Предыдущее
От: shveta malik
Дата:
Сообщение: Re: Conflict detection and logging in logical replication
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: speed up a logical replica setup