Re: jsonpath
От
Tomas Vondra
Тема
Re: jsonpath
Дата
Msg-id
67128b8b-2d80-9e51-20a8-9ac8e0e2243e@2ndquadrant.com
Ответ на
Re: jsonpath (Tomas Vondra)
Список
Дерево обсуждения
jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Pavel Stehule <pavel.stehule@gmail.com>
Re: jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Pavel Stehule <pavel.stehule@gmail.com>
Re: jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Pavel Stehule <pavel.stehule@gmail.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Oleg Bartunov <obartunov@gmail.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Oleg Bartunov <obartunov@gmail.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Robert Haas <robertmhaas@gmail.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath David Steele <david@pgmasters.net>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Thomas Munro <thomas.munro@enterprisedb.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Stas Kelvich <s.kelvich@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Michael Paquier <michael@paquier.xyz>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Oleg Bartunov <obartunov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Oleg Bartunov <obartunov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Andres Freund <andres@anarazel.de>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Michael Paquier <michael@paquier.xyz>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Andres Freund <andres@anarazel.de>
Re: jsonpath Andres Freund <andres@anarazel.de>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Andres Freund <andres@anarazel.de>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Andres Freund <andres@anarazel.de>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Andres Freund <andres@anarazel.de>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Pavel Stehule <pavel.stehule@gmail.com>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath "Jonathan S. Katz" <jkatz@postgresql.org>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath "Jonathan S. Katz" <jkatz@postgresql.org>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath "Jonathan S. Katz" <jkatz@postgresql.org>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath "Jonathan S. Katz" <jkatz@postgresql.org>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Pavel Stehule <pavel.stehule@gmail.com>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Jeff Janes <jeff.janes@gmail.com>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Tom Lane <tgl@sss.pgh.pa.us>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Nikita Glukhov <n.gluhov@postgrespro.ru>
Re: jsonpath Oleg Bartunov <obartunov@postgrespro.ru>
Re: jsonpath John Naylor <john.naylor@2ndquadrant.com>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Andres Freund <andres@anarazel.de>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Robert Haas <robertmhaas@gmail.com>
Re: jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Pavel Stehule <pavel.stehule@gmail.com>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath John Naylor <john.naylor@2ndquadrant.com>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Alexander Korotkov <a.korotkov@postgrespro.ru>
Re: jsonpath Dmitry Dolgov <9erthalion6@gmail.com>
Re: jsonpath Oleg Bartunov <obartunov@postgrespro.ru>
Re: jsonpath Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: jsonpath Oleg Bartunov <obartunov@gmail.com>
A bunch of additional comments, after looking at the patch a bit today.
All are mostly minor, and sometime perhaps a matter of preference.
1) There's a mismatch between the comment and actual function name for
jsonb_path_match_opr and jsonb_path_exists_opr(). The comments say
"_novars" instead.
2) In a couple of switches the "default" case does a return with a
value, following elog(ERROR). So it's practically unreachable, AFAICS
it's fine without it, and we don't do this elsewhere. And I don't get
any compiler warnings if I remove it either.
Examples:
JsonbTypeName
default:
elog(ERROR, "unrecognized jsonb value type: %d", jbv->type);
return "unknown";
jspOperationName
default:
elog(ERROR, "unrecognized jsonpath item type: %d", type);
return NULL;
compareItems
default:
elog(ERROR, "unrecognized jsonpath operation: %d", op);
return jpbUnknown;
3) jsonpath_send is using makeStringInfo() for a value that is not
returned - IMHO it should use regular stack-allocated variable and use
initStringInfo() instead
4) the version number should be defined/used as a constant, not as a
magic constant somewhere in the code
5) Why does jsonPathToCstring do this?
appendBinaryStringInfo(out, "strict ", 7);
Why not to use regular appendStringInfoString()? What am I missing?
6) comment typo: "Aling StringInfo"
7) alignStringInfoInt() should explain why we need this and why INTALIGN
is the right alignment.
8) I'm a bit puzzled by what flattenJsonPathParseItem does with 'next'
I don't quite understand what it's doing with 'next' value?
/*
* Actual value will be recorded later, after next and children
* processing.
*/
appendBinaryStringInfo(buf,
(char *) &next, /* fake value */
sizeof(next));
Perhaps a comment explaining it (why we need a fake value at all?) would
be a good idea here.
9) I see printJsonPathItem is only calling check_stack_depth while
flattenJsonPathParseItem also calls CHECK_INTERRUPTS. Why the
difference, considering they seem about equally expensive?
10) executeNumericItemMethod is missing a comment (unlike the other
executeXXX functions)
11) Wording of some of the error messages in the execute methods seems a
bit odd. For example executeNumericItemMethod may complain that it
... is applied to not a numeric value
but perhaps a more natural wording would be
... is applied to a non-numeric value
And similarly for the other execute methods. But I'm not a native
speaker, so perhaps the original wording is just fine.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления