Re: In need of some JSONB examples ? - Mailing list pgsql-general

From Tim Smith
Subject Re: In need of some JSONB examples ?
Date
Msg-id CA+HuS5HD3zh41h8m==24gEN56UvCdN21KMn-DM-tw+dRKJ4XBA@mail.gmail.com
Whole thread Raw
In response to Re: In need of some JSONB examples ?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: In need of some JSONB examples ?  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
> How does it not work?
> In other words what was the query you tried and what was the output?

As in, it doesn't work.   Full stop....

\d+ json_test
                      Table "public.json_test"
 Column  | Type  | Modifiers | Storage  | Stats target | Description
---------+-------+-----------+----------+--------------+-------------
 content | jsonb | not null  | extended |              |
Indexes:
    "idxgin" gin (content)


 truncate json_test;
TRUNCATE TABLE
 insert into json_test(content)  values('[{"ID": "3119","Desc":"bob"}]');
INSERT 0 1

select content->'Desc' from json_test where content @> '{"ID":"3119"}';
 ?column?
----------
(0 rows)

On 23 January 2015 at 15:50, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> On 01/23/2015 07:40 AM, Tim Smith wrote:
>>
>> re: (a)
>>
>>> see the documentation pertaining to 'jsonb indexing', to wit:
>>>
>>> -- Find documents in which the key "company" has value "Magnafone"
>>> SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @> '{"company":
>>> "Magnafone"}';
>>
>>
>> Nope, sorry, tried that.  Doesn't work for me. Hence the question.  ;-)
>
>
> How does it not work?
> In other words what was the query you tried and what was the output?
>
>
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: In need of some JSONB examples ?
Next
From: Adrian Klaver
Date:
Subject: Re: In need of some JSONB examples ?