Re: jsonb and nested hstore
От | Greg Stark |
---|---|
Тема | Re: jsonb and nested hstore |
Дата | |
Msg-id | CAM-w4HPxbtyKyFOZfZb8r4s64EbaYjDiPTZ2cNFNDvB2RZCQhQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: jsonb and nested hstore (Greg Stark <stark@mit.edu>) |
Ответы |
Re: jsonb and nested hstore
|
Список | pgsql-hackers |
Fwiw I have a few questions -- but beware, I'm a complete neophyte when it comes to jsonb style document databases so these are more likely to represent misconceptions on my part than problems with jsonb. I naively though a gin index on a jsonb would help with queries like WHERE col->'prop' = 'val'. In fact it only seems to help with WHERE col ? 'prop'. To help with the former it looks like I need an expression index on col->'prop' is that right? There doesn't seem to be an operator that combines both a dereference and value test into a single operator so I don't think our index machinery can deal with this. Or am I supposed to use contains and construct a json object for the test? I also find it awkward that col->>'prop' returns the json representation of the property. If it's text that means it's double-quoted. I would think that a user storing text in a json property would want a way to pull out the text that json property represents so he doesn't have to write col->>'prop' = '"foo"' and doesn't need to strip the quotes (and de-escape the string?) before displaying the value or passing it through other apis.
В списке pgsql-hackers по дате отправления: