Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XJuY6-0006Ha-DJ for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Aug 2014 01:18:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XJuY5-0002Hk-M4 for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Aug 2014 01:18:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XJuY4-0002Hd-PW for pgsql-bugs@postgresql.org; Wed, 20 Aug 2014 01:18:48 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XJuXy-0007RF-G1 for pgsql-bugs@postgresql.org; Wed, 20 Aug 2014 01:18:46 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1XJuXu-0002aE-M5 for pgsql-bugs@postgresql.org; Tue, 19 Aug 2014 18:18:38 -0700 Date: Tue, 19 Aug 2014 18:18:38 -0700 (PDT) From: David G Johnston To: pgsql-bugs@postgresql.org Message-ID: <1408497518662-5815490.post@n5.nabble.com> In-Reply-To: <22294.1408487132@sss.pgh.pa.us> References: <20140818195634.2543.56277@wrigleys.postgresql.org> <22294.1408487132@sss.pgh.pa.us> Subject: Re: BUG #11207: empty path will segfault jsonb #> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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.html 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