RE: Working with JSONB data having node lists

Поиск
Список
Период
Сортировка
От Steven Winfield
Тема RE: Working with JSONB data having node lists
Дата
Msg-id E9FA92C2921F31408041863B74EE4C2001A47A07DB@CCPMAILDAG03.cantab.local
обсуждение исходный текст
Ответ на Re: Working with JSONB data having node lists  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general

If you can do this one without unnesting the downloads array I do not know how.  Having done that: (WHERE dlarray->'publd' = '123)

 

I think it’s doable like this:

 

select * from contacts where data @> '{"downloads":[{"pubid":123}]}'::jsonb

 

…which would be aided by a gin index on ‘data’ using jsonb_path_ops:

 

CREATE INDEX idx_data_path_ops on contacts USING gin (data jsonb_path_ops);

https://www.postgresql.org/docs/10/static/datatype-json.html#JSON-INDEXING

 

Best,

Steve.





This email is confidential. If you are not the intended recipient, please advise us immediately and delete this message. The registered name of Cantab- part of GAM Systematic is Cantab Capital Partners LLP. See - http://www.gam.com/en/Legal/Email+disclosures+EU for further information on confidentiality, the risks of non-secure electronic communication, and certain disclosures which we are required to make in accordance with applicable legislation and regulations. If you cannot access this link, please notify us by reply message and we will send the contents to you.

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: PostgreSQL Kerberos Authentication
Следующее
От: Pavel Suderevsky
Дата:
Сообщение: Understanding Huge Pages