pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: ameenahsanma@gmail.com
To: pgsql-docs@lists.postgresql.org
Subject: Re: Table 9-40. json and jsonb Operators - Data could be more informative
Date: Thu, 17 Oct 2019 10:42:16 +0900
Message-ID: <20191017014216.GE5605@paquier.xyz> (raw)
In-Reply-To: <157111158709.25314.5025115144658634556@wrigleys.postgresql.org>
References: <157111158709.25314.5025115144658634556@wrigleys.postgresql.org>

On Tue, Oct 15, 2019 at 03:53:07AM +0000, PG Doc comments form wrote:
> the table 9.40, json and jsonb operators 
> lists '->>' and '#>>' operators and the difference written is the second one
> go to the specific location.
> 
> I am not an expert in postgres!
> But from my experience,
> '#>>'  can also parse the data when it is a stringified JSON, having escape
> charterers in it!

Input is always welcome, thanks!

> for ex :
> for a scalar value in jsonb : "{\"attr\":\"value\"}", from which we cannot
> read keys or values as such,
> 
> Query : select (column #>> '{}') from table;
> will give parsed json : {"attr" : "value"} from which keys and values can be
> extracted.
> 
> please mention is there if it is right, as i struggled a lot to figure it
> out!
> 
> PS: pardon my language, and my concern if it is not right!

Perhaps this could be improved.  How would you shape that as a patch?
From the source tree you would need to change the table around the
section "Processing and Creating JSON Data" in src/sgml/func.sgml.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (2+ messages)

Message-ID: <20191017014216.GE5605@paquier.xyz>
Permalink:  ../20191017014216.GE5605@paquier.xyz/
Also on:    postgresql.org/message-id/20191017014216.GE5605@paquier.xyz

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: michael@paquier.xyz, ameenahsanma@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: Table 9-40. json and jsonb Operators - Data could be more informative
  In-Reply-To: <20191017014216.GE5605@paquier.xyz>

* 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