Re: jsonpath

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, Michael Paquier <michael(at)paquier(dot)xyz>, Stas Kelvich <s(dot)kelvich(at)postgrespro(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, David Steele <david(at)pgmasters(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Oleg Bartunov <obartunov(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: jsonpath
Date: 2019-01-20 03:30:45
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On Sun, Jan 20, 2019 at 2:45 AM Alexander Korotkov
<a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> 3) How do we calculate the "id" property returned by keyvalue()
> function? It's not documented. Even presence of "id" columns isn't
> documented. Standard stands that it's implementation-depended
> indetifier of object holding key-value pair. The way of its
> calculation is also not clear from the code. Why do we need constant
> of 10000000000?
> id = jb->type != jbvBinary ? 0 :
> (int64)((char *) jb-> -
> (char *) cxt->baseObject.jbc);
> id += (int64) cxt-> * INT64CONST(10000000000);

I've revising patchset bringing it to commitable shape. The
intermediate result is attached.


* Commit message & minor cleanup


* Support of json is removed. Current implementation is tricky and
cumbersome. We need to design a suitable abstraction layer for that.
It should be done by separate patch applying not only to jsonpath, but
also to other jsonb functions lacking of json analogues.
* jsonpath_exists(jsonb, jsonpath[, jsonb]), jsonpath_predicate(jsonb,
jsonpath[, jsonb]), jsonpath_query(jsonb, jsonpath[, jsonb]),
jsonpath_wrapped(jsonb, jsonpath[, jsonb]) are documented.
* @* and @# operators are removed, @~ operator is renamed to @@.
* Commit message & minor cleanup.

I'll continue revising this patchset. Nikita, could you please write
tests for 3-argument versions of functions? Also, please answer the
question regarding "id" property.

Alexander Korotkov
Postgres Professional:
The Russian Postgres Company

Attachment Content-Type Size
0001-Preliminary-datetime-infrastructure-v24.patch application/octet-stream 32.4 KB
0002-Jsonpath-engine-and-docs-v24.patch application/octet-stream 280.8 KB

In response to

  • Re: jsonpath at 2019-01-19 23:45:10 from Alexander Korotkov


  • Re: jsonpath at 2019-01-20 22:40:28 from Alexander Korotkov

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-01-20 03:44:39 Re: [PATCH] Fix Proposal - Deadlock Issue in Single User Mode When IO Failure Occurs
Previous Message Paul Martinez 2019-01-20 03:04:15 Re: [PROPOSAL] ON DELETE SET NULL (<column_list>) for Foreign Key Constraints