Re: BUG #11207: empty path will segfault jsonb #> - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #11207: empty path will segfault jsonb #>
Date
Msg-id 22294.1408487132@sss.pgh.pa.us
Whole thread Raw
In response to BUG #11207: empty path will segfault jsonb #>  (justin.vanwinkle@gmail.com)
Responses Re: BUG #11207: empty path will segfault jsonb #>  (David G Johnston <david.g.johnston@gmail.com>)
Re: BUG #11207: empty path will segfault jsonb #>  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
justin.vanwinkle@gmail.com 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.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #11211: regexp_matches acts like a WHERE
Next
From: David G Johnston
Date:
Subject: Re: BUG #11207: empty path will segfault jsonb #>