Re: [PATH] Jsonb, insert a new value into an array at arbitrary position

Поиск
Список
Период
Сортировка
От Petr Jelinek
Тема Re: [PATH] Jsonb, insert a new value into an array at arbitrary position
Дата
Msg-id 56D48FD5.8030703@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: [PATH] Jsonb, insert a new value into an array at arbitrary position  (Dmitry Dolgov <9erthalion6@gmail.com>)
Список pgsql-hackers
On 29/02/16 18:19, Dmitry Dolgov wrote:
>  > I'd strongly prefer the jsonb_array_insert naming though
>  > I don't think it's a good idea to use set when this is used on
> object, I think that we should throw error in that case.
>
> Well, I thought it's wrong to introduce different functions and
> behaviour patterns for objects and arrays, because it's the one data
> type after all. But it's just my opinion of course.
>

The problem I see with that logic is because we don't keep order of keys 
in the jsonb object the "insert" in the name will have misleading 
implications from the point of the user. Also it does not do anything 
for object that "set" doesn't do already, so why have two interfaces for 
doing same thing.

--   Petr Jelinek                  http://www.2ndQuadrant.com/  PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_dump / copy bugs with "big lines" ?
Следующее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: Publish autovacuum informations