Re: How to search a string inside a json structure - Mailing list pgsql-general

From Sami Pietilä
Subject Re: How to search a string inside a json structure
Date
Msg-id CAN08J2ib3Pu88HSUiN4QLk3qSyP2LrkyZ+cPDu1H2Z5KVM0NBA@mail.gmail.com
Whole thread Raw
In response to Re: How to search a string inside a json structure  ("Jason O'Donnell" <odonnelljp01@gmail.com>)
Responses Re: How to search a string inside a json structure
List pgsql-general
Hi,

Thank you for reply!

I am using version 9.4.5.

Unfortunately I could not figure out how to select rows which, for example, contain following json: '{"a":"world","c":{"b":"helloworld"}}' by search with "hello" string.

I am trying to create a query which looks values in any field in JSON, "a" and "b" in this case (without knowing the names "a" and "b").

Thanks

2015-11-03 0:56 GMT+02:00 Jason O'Donnell <odonnelljp01@gmail.com>:
Sami,

What version of postgres are you using?

There's some examples using GIN indexes for searching jsonb objects in the wiki: https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.4#JSONB_Binary_JSON_storage

Hope that helps,

pgsql-general by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: pg_archivecleanup not deleting anything?
Next
From: Vick Khera
Date:
Subject: Re: How to search a string inside a json structure