Re: How to search a string inside a json structure

From: Sami Pietilä <sami(dot)pietila(at)gmail(dot)com>
To: "Jason O'Donnell" <odonnelljp01(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to search a string inside a json structure
Date: 2015-11-03 15:07:01
Message-ID: CAN08J2ib3Pu88HSUiN4QLk3qSyP2LrkyZ+cPDu1H2Z5KVM0NBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)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,
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2015-11-03 15:57:15 Re: How to search a string inside a json structure
Previous Message Ramesh T 2015-11-03 14:42:56 Taking lot time