Re: json indexing and data types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: json indexing and data types
Дата
Msg-id 9371.1449115492@sss.pgh.pa.us
обсуждение исходный текст
Ответ на json indexing and data types  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: json indexing and data types  (Merlin Moncure <mmoncure@gmail.com>)
Re: json indexing and data types  (Kaare Rasmussen <kaare@jasonic.dk>)
Re: json indexing and data types  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
Merlin Moncure <mmoncure@gmail.com> writes:
> On Wed, Dec 2, 2015 at 12:03 AM, Kaare Rasmussen <kaare@jasonic.dk> wrote:
>> As json essentially only has three basic data types, string, int, and
>> boolean, I wonder how much of this - to index, search, and sort on
>> unstructured data -  is possible.

> I feel your pain.  jsquery is superb for subdocument searching on
> *specific* subdocuments but range searching is really limited.

Yeah.  The problem here is that a significant part of the argument for
the JSON/JSONB datatypes was that they adhere to standards (RFC 7159 in
particular).  I can't see us accepting a patch that changes them into
JSON-plus-some-PG-enhancements.

For cases where you know that specific sub-fields can be expected to be
of particular datatypes, I think you could get a lot of mileage out of
functional indexes ... but you'd have to write your queries to match the
indexes, which could be painful.

(Having said that, it sure looks to me like JSON's idea of a number is
float/numeric, not merely int.  Are you sure you need more capability
in that department, and if so what exactly?)

            regards, tom lane


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

Предыдущее
От: Dennis
Дата:
Сообщение: Re: loading data into cluster - can I daisy-chain streaming replication?
Следующее
От: mdaswani
Дата:
Сообщение: Support for hardware tokens for server/replication private key