Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> 2016-01-24 11:47 GMT+01:00 <xtracoder(at)gmail(dot)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