Re: sql/json remaining issue

Поиск
Список
Период
Сортировка
От jian he
Тема Re: sql/json remaining issue
Дата
Msg-id CACJufxEuP0Cre4voQb+Re7DmYyJxy76HojLXgPmBoyowGXO6KA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: sql/json remaining issue  (Amit Langote <amitlangote09@gmail.com>)
Ответы Re: sql/json remaining issue  (jian he <jian.universality@gmail.com>)
Re: sql/json remaining issue  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers
On Fri, Apr 12, 2024 at 5:44 PM Amit Langote <amitlangote09@gmail.com> wrote:
>
> > elog(ERROR, "unrecognized json wrapper %d", wrapper);
> > should be
> > elog(ERROR, "unrecognized json wrapper %d", (int) wrapper);
>
> Fixed in 0003.
>
the fix seems not in 0003?
other than that, everything looks fine.


<programlisting>
SELECT * FROM JSON_TABLE (
'{"favorites":
    {"movies":
      [{"name": "One", "director": "John Doe"},
       {"name": "Two", "director": "Don Joe"}],
     "books":
      [{"name": "Mystery", "authors": [{"name": "Brown Dan"}]},
       {"name": "Wonder", "authors": [{"name": "Jun Murakami"},
{"name":"Craig Doe"}]}]
}}'::json, '$.favs[*]'
COLUMNS (user_id FOR ORDINALITY,
  NESTED '$.movies[*]'
    COLUMNS (
    movie_id FOR ORDINALITY,
    mname text PATH '$.name',
    director text),
  NESTED '$.books[*]'
    COLUMNS (
      book_id FOR ORDINALITY,
      bname text PATH '$.name',
      NESTED '$.authors[*]'
        COLUMNS (
          author_id FOR ORDINALITY,
          author_name text PATH '$.name'))));
</programlisting>

I actually did run the query, it returns null.
'$.favs[*]'
should be
'$.favorites[*]'



one more minor thing, I previously mentioned in getJsonPathVariable
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("could not find jsonpath variable \"%s\"",
pnstrdup(varName, varNameLength))));

do we need to remove pnstrdup?



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

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: Re: Fix possible dereference null pointer (src/backend/replication/logical/reorderbuffer.c)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why is parula failing?