Re: Unexpected extra row from jsonb_path_query() with a recursive path

Michael Paquier <[email protected]>
Newsgroups gmane.comp.db.postgresql.bugs
Message-ID <[email protected]>
On Mon, Dec 09, 2019 at 09:37:23AM +0100, Jan Przemysław Wójcik wrote:
> Yes, there is the only object with the attribute 'key' and its value
> should be returned. Note, that a non-recursive path on the same JSON
> correctly returns a single row:
> 
> select jsonb_path_query('{"data": [{"key": "value"}]}', '$.*.key')
> 
>  jsonb_path_query
> ------------------
>  "value"
> (1 row)

Yeah, that result is right.  Something looks wrong regarding the
lookup of an array's elements when doing a recursion.  Let's wait a
bit to see if Nikita or Alexander have anything to share as they
implemented the feature.  If not, I'll try to take a closer look at
this issue.
--
Michael
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3vBQ0ACgkQnvQgOdby
QH2jmxAApVALHDeWsZ7RDWQUUHIYOGHUEu2JHbdhpPZAL3xFouCm+dXJwHeMRcKd
TaDBpvO/0TsZUImezkR1gUY7xQ9z+zLHJBXrGAWKnCL/4gswlfHxSXs/NrDIeqV5
Ge3w3CD5t7YZYwiI7pIuTCV2cT3QNb2aSS88ufohUy4HR7frljEBPn+A7+g1/OnH
DDgt76qj15dYUMxiQCFr6ZWcabj3Doen9ny30KpZEzsNIGC0nCowQyycXFXFcooC
+6+YQvubS29Rac8Z1wcelb5kI0CepCueOqF6Tud7v3uTynB7pF6sYoMKc0N5lXBp
JlNaiKVk3gPGUvUalAqOo5Qt6f6ti+YpBMaDK+utaTvTGvdVrIImBrqnWJrdEy+u
mm152nvekbQgJ0MjffQBW3XjWhIOtcd2p7KQq1gzIPuodFJkOM9xAgqw5ki3kmB5
WvUHB1CMdYXOnVTxhlBJIaDKlsahuF6pqZDMdi8+12r8kOMJ7nyuMSGRXg/C8oh/
7gZ5GA0jShKv6fCTofFk6QvsbRofHQFuwdBnFLZcVciyHM8lmsSdQIkuXJOSeviW
bd0fjbqCfnwI9A9YqiuRYhtaN87gR4YazWaI16F1bXRooI6wBobtQhcBxayb11Mi
48HzIAlXS/s9Hgao/r5MIB2JKoL1/pdYXGPimICrLBNZmi1U2Pc=
=wPPI
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.