pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Table 9-40. json and jsonb Operators - Data could be more informative
2+ messages / 2 participants
[nested] [flat]

* Table 9-40. json and jsonb Operators - Data could be more informative
@ 2019-10-15 03:53  PG Doc comments form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Doc comments form @ 2019-10-15 03:53 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: ameenahsanma@gmail.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.4/functions-json.html
Description:

In https://www.postgresql.org/docs/9.4/functions-json.html,

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! 

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!

Thank you!


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Table 9-40. json and jsonb Operators - Data could be more informative
@ 2019-10-17 01:42  Michael Paquier <michael@paquier.xyz>
  parent: PG Doc comments form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2019-10-17 01:42 UTC (permalink / raw)
  To: ameenahsanma@gmail.com; pgsql-docs@lists.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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-10-17 01:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15 03:53 Table 9-40. json and jsonb Operators - Data could be more informative PG Doc comments form <noreply@postgresql.org>
2019-10-17 01:42 ` Michael Paquier <michael@paquier.xyz>

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