How to search a string inside a json structure

From: Sami Pietilä <sami(dot)pietila(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to search a string inside a json structure
Date: 2015-11-02 21:09:58
Message-ID: CAN08J2jQP3NN_dwOtO6BvbRE_jnBDRiOfsc73-4vHwdKRXUQtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a database with jsonb type of columns. Colums contain complex json
structures. I would like to get all rows which contain a json where any of
json's values matches to a given string (like %hello%).

How to create a postgre sql query to do this?

I guess postgre should traverse though each json structures while finding
the string.

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2015-11-02 21:17:04 Re: Waiting on ExclusiveLock on extension 9.3, 9.4 and 9.5
Previous Message Jim Longwill 2015-11-02 19:08:04 Re: Configure Different Databases on One Server