Re: BUG #13884: array_to_json() works incorrectly for non-0-based arrays

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #13884: array_to_json() works incorrectly for non-0-based arrays
Дата
Msg-id 13299.1453741077@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #13884: array_to_json() works incorrectly for non-0-based arrays  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: BUG #13884: array_to_json() works incorrectly for non-0-based arrays  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2016-01-24 11:47 GMT+01:00 <xtracoder@gmail.com>:
>> When postgres array has no elements at the beginning, array_to_json()
>> generates json array starting at the first initialized value

> It doesn't looks like bug - It hard to say, when is a start of PostgreSQL
> array and how PostgreSQL arrays should be serialized to JSON. First field
> in pg array is a first field in JSON array.

The current behavior looks reasonable to me too.  Certainly the proposed
change wouldn't be any more consistent --- what would happen when you had
elements with subscripts less than 1?

            regards, tom lane

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: BUG #13884: array_to_json() works incorrectly for non-0-based arrays
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #13884: array_to_json() works incorrectly for non-0-based arrays