From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: xtracoder@gmail.com, "pgsql-bugs@postgresql.org" <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13884: array_to_json() works incorrectly for non-0-based arrays
Date: Mon, 25 Jan 2016 11:57:57 -0500
Message-ID: <13299.1453741077@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFj8pRAmrXqDYUKSsDYpBxqSQSzH5isU_O_Db9__gAPpcCkOCQ@mail.gmail.com>
References: <20160124104702.2537.84835@wrigleys.postgresql.org>
<CAFj8pRAmrXqDYUKSsDYpBxqSQSzH5isU_O_Db9__gAPpcCkOCQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pavel.stehule@gmail.com
Subject: Re: BUG #13884: array_to_json() works incorrectly for non-0-based arrays
In-Reply-To: <13299.1453741077@sss.pgh.pa.us>
References: <20160124104702.2537.84835@wrigleys.postgresql.org> <CAFj8pRAmrXqDYUKSsDYpBxqSQSzH5isU_O_Db9__gAPpcCkOCQ@mail.gmail.com> <13299.1453741077@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox