Re: additional json functionality

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: additional json functionality
Дата
Msg-id 528A5810.8070903@agliodbs.com
обсуждение исходный текст
Ответ на additional json functionality  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: additional json functionality  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
Merlin,

> *) Aside from the text in and out routines, how is 'jsbonb' different
> from the coming 'nested hstore'?   Enough to justify two code bases?

In/out functions and defaults are all different.  Otherwise, the two
types will be accessing the same code base, so no duplication.  Think of
is as XML vs. TEXT.

> Maybe we can cheat a little bit overload the functions so that one the
> existing APIs (hstore or json) can be recovered -- only adding what
> minimal functionality needs to be added to handle the type distinction
> (mostly on serialization routines and casts).  What I'm driving at
> here is that it would be nice if the API was not strongly bifurcated:
> this would cause quite a bit of mindspace confusion.

I'll also note that for functions designed for output to the client, it
doesn't make much of a difference whether the result is JSON or JSONB,
since the string representation will be identical.  However, it makes a
difference if the data is going to be stored, since a double conversion
on a large JSON value would be expensive.

In other words, we need a version of each function which outputs JSONB,
but that version doesn't have to be the default if users don't specify.

Note that this raises the issue of "first alternate data type ambiguity"
again for overloading builtin functions.  We really need that method of
"prefering" a specific version of the function ...

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: New option for pg_basebackup, to specify a different directory for pg_xlog
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: CLUSTER FREEZE