Re: Table 9-40. json and jsonb Operators - Data could be more informative
Michael Paquier <[email protected]> Thu, 17 Oct 2019 10:42:16 +0900
| Newsgroups | gmane.comp.db.postgresql.devel.documentation |
|---|---|
| Message-ID | <[email protected]> |
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
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl2nxvgACgkQnvQgOdby QH2lOg//dVSIWne0JJpVkd57JJm+r+WfDKnBtOxx+/e8JI44kq0tYdKeIw4sj5k/ blEJ5xvEVA+2+WpIqAjrwHcMXNMHJwHBhL0wmNVOqmBASil00VBtB5kEFcRQbM4A Hd6okNMfA0/hQanrudJri5Y6UCuYG0h9WC2VHJJiJP3u35pt9tKeAmLZ0Txh0abl obspQCrciMd6FsM61R+vgUPpaul9dFhnfw6ARncgYRU3y18NRto07j94TW/i2clQ tMkXnscA9URXqf64FpJ+hUj7ezN3oRAwxnVk5q2C8e5nfZ7deCWZJrDeGE1rMPPU rvhy2xSqfv5otOUM8lp6YLxR8URbXQCEHQvPDONaIt6+cNuFwWLT1QF/Kv5CTPiH EbYLG/WyUGnrZkq7UH9bn5HNKW8/tZh+hoj+KLKUEcOE+8lJ6WCihlfrj46Owrmi WrO52ODKSKhDbERHL5Gl4cUaQT/fOWdX3veL/H1SLnHn7Sa5Xy4MVoufisY/zIaB VE7YEwzcApSVyteIdlSjMvWcI1Qqbe43GY0Up6TEqteGXDy5F0ZGDJNjSUYDFyYo HMXwtebkw/7Aju7RLlFi61r7774ANhUwEL8IEGcSHbgx2PAbsGKWLd+3QHuzmDO6 9zpU37tD8Hlmr2TCK5MRjy9hs3+X8J4cYvHFOfiDZOr0W5jo/MQ= =ZCIT -----END PGP SIGNATURE-----