Re: remaining sql/json patches

Поиск
Список
Период
Сортировка
От jian he
Тема Re: remaining sql/json patches
Дата
Msg-id CACJufxHk6XzHTzz=35dAVCT3-uVwknsgt8ycAv49_ZjmP53EdA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: remaining sql/json patches  (jian he <jian.universality@gmail.com>)
Ответы Re: remaining sql/json patches  (jian he <jian.universality@gmail.com>)
Re: remaining sql/json patches  (jian he <jian.universality@gmail.com>)
Список pgsql-hackers
On Sun, Mar 10, 2024 at 10:57 PM jian he <jian.universality@gmail.com> wrote:
>
> one more issue.

Hi
one more documentation issue.
after applied V42, 0001 to 0003,
there are 11 appearance of `FORMAT JSON` in functions-json.html
still not a single place explained what it is for.

json_query ( context_item, path_expression [ PASSING { value AS
varname } [, ...]] [ RETURNING data_type [ FORMAT JSON [ ENCODING UTF8
] ] ] [ { WITHOUT | WITH { CONDITIONAL | [UNCONDITIONAL] } } [ ARRAY ]
WRAPPER ] [ { KEEP | OMIT } QUOTES [ ON SCALAR STRING ] ] [ { ERROR |
NULL | EMPTY { [ ARRAY ] | OBJECT } | DEFAULT expression } ON EMPTY ]
[ { ERROR | NULL | EMPTY { [ ARRAY ] | OBJECT } | DEFAULT expression }
ON ERROR ])

FORMAT JSON seems just a syntax sugar or for compatibility in json_query.
but it returns an error when the returning type category is not
TYPCATEGORY_STRING.

for example, even the following will return an error.
`
CREATE TYPE regtest_comptype AS (b text);
SELECT JSON_QUERY(jsonb '{"a":{"b":"c"}}', '$.a' RETURNING
regtest_comptype format json);
`

seems only types in[0] will not generate an error, when specifying
FORMAT JSON in JSON_QUERY.

so it actually does something, not a syntax sugar?

[0] https://www.postgresql.org/docs/current/datatype-character.html



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

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: [PoC] Improve dead tuple storage for lazy vacuum
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Missing LWLock protection in pgstat_reset_replslot()