From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11207: empty path will segfault jsonb #>
Date: Tue, 19 Aug 2014 18:18:38 -0700 (PDT)
Message-ID: <1408497518662-5815490.post@n5.nabble.com> (raw)
In-Reply-To: <22294.1408487132@sss.pgh.pa.us>
References: <20140818195634.2543.56277@wrigleys.postgresql.org>
<22294.1408487132@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Tom Lane-2 wrote
> justin.vanwinkle@
> writes:
>> select '{"a": {"b":{"c": "foo"}}}'::jsonb #> '{}';
>> [ dumps core ]
>
> Hm. It's not immediately obvious to me what this should be defined to do;
> should it throw an error, or return the complete LHS object, or perhaps
> return a NULL? But the author of get_jsonb_path_all() evidently didn't
> consider the case.
>
> Easy enough to fix once we settle on a definition.
As there is no immediately obvious way to return the entire LHS when using
this operator it doesn't seem that far-fetched to define this as the syntax
that would do so - though then there wouldn't be a way to not return the
entire LHS without providing a known invalid key (maybe '{NULL}' - what
would that do now anyway...)
Not that we would necessarily want to duplicate hstore but "hstore ->
text[]" seems similar enough to emulate if desired.
David J.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11207-empty-path-will-segfault-jsonb-tp5815469p5815490.h...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: david.g.johnston@gmail.com
Subject: Re: BUG #11207: empty path will segfault jsonb #>
In-Reply-To: <1408497518662-5815490.post@n5.nabble.com>
References: <20140818195634.2543.56277@wrigleys.postgresql.org> <22294.1408487132@sss.pgh.pa.us> <1408497518662-5815490.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox