Re: How to search a string inside a json structure

From: "Jason O'Donnell" <odonnelljp01(at)gmail(dot)com>
To: sampie(at)iki(dot)fi
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to search a string inside a json structure
Date: 2015-11-02 22:56:12
Message-ID: CAOYeSOfrPbi6WOUShwBt6D8mZA07KeKbyEMR-4iZEUCYS3LJtA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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,

On Mon, Nov 2, 2015 at 4:09 PM, Sami Pietilä <sami(dot)pietila(at)gmail(dot)com> wrote:

> 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
>

--
Jason O'Donnell
Crunchy Data Solutions

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Emanuel Calvo 2015-11-03 00:59:54 Re: Approach to extract top records from table based upon aggregate
Previous Message Jeff Janes 2015-11-02 22:28:25 Re: Is there bigintarray?