inequality testing in jsonb query

Поиск
Список
Период
Сортировка
От Larry White
Тема inequality testing in jsonb query
Дата
Msg-id CAMdbzVgiwdq-7xijz7s8eUyvzm1WeV0nAZcdmFQz_bHW6n=W_A@mail.gmail.com
обсуждение исходный текст
Ответы Re: inequality testing in jsonb query  ("vibhor.kumar@enterprisedb.com" <vibhor.kumar@enterprisedb.com>)
Список pgsql-general
Hi, 

Is it possible to query a table with a jsob column to find values that were in some range? For example, If I have a document like this (from the PG documentation:

{
    "guid": "9c36adc1-7fb5-4d5b-83b4-90356a46061a",
    "name": "Angela Barton",
    "is_active": true,
    "company": "Magnafone",
    "address": "178 Howard Place, Gulf, Washington, 702",
    "registered": "2009-11-07T08:53:22 +08:00",
    "latitude": 19.793713,
    "longitude": 86.513373,
    "tags": [
        "enim",
        "aliquip",
        "qui"
    ]
}

Could I modify the following query to find those records where the date "registered" is between November 1, 2009 and November 30, 2009? 

SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @> '{"company": "Magnafone"}';


Thank you for your help.

larry

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Question regarding log files in postgresql
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Need r_constraint_name