Re: json api WIP patch

Поиск
Список
Период
Сортировка
Искать
От
Merlin Moncure
Тема
Re: json api WIP patch
Дата
Msg-id
CAHyXU0y6GDcTxqD+jRHJ5M39kNZbDNEUXCA1-Mc_HHbL+ebqhQ@mail.gmail.com
Ответ на
Re: json api WIP patch (David Fetter)
Список
Дерево обсуждения
json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Robert Haas <robertmhaas@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Peter Eisentraut <peter_e@gmx.net>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Hannu Krosing <hannu@krosing.net>
Re: json api WIP patch Pavel Stehule <pavel.stehule@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Pavel Stehule <pavel.stehule@gmail.com>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch Tom Lane <tgl@sss.pgh.pa.us>
Re: json api WIP patch Robert Haas <robertmhaas@gmail.com>
Re: json api WIP patch Daniel Farina <daniel@heroku.com>
Re: json api WIP patch Tom Lane <tgl@sss.pgh.pa.us>
Re: json api WIP patch Robert Haas <robertmhaas@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Robert Haas <robertmhaas@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch "David E. Wheeler" <david@justatheory.com>
Re: json api WIP patch Robert Haas <robertmhaas@gmail.com>
Re: json api WIP patch Daniel Farina <daniel@heroku.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Daniel Farina <daniel@heroku.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Will Leinweber <will@heroku.com>
Re: json api WIP patch Benedikt Grundmann <bgrundmann@janestreet.com>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch "David E. Wheeler" <david@justatheory.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: json api WIP patch Tom Lane <tgl@sss.pgh.pa.us>
Re: json api WIP patch "David E. Wheeler" <david@justatheory.com>
Re: json api WIP patch Robert Haas <robertmhaas@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Robert Haas <robertmhaas@gmail.com>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch David Fetter <david@fetter.org>
Re: json api WIP patch Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Daniel Farina <daniel@heroku.com>
Re: json api WIP patch "David E. Wheeler" <david.wheeler@pgexperts.com>
Re: json api WIP patch Pavel Stehule <pavel.stehule@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Pavel Stehule <pavel.stehule@gmail.com>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch james <james@mansionfamily.plus.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch james <james@mansionfamily.plus.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch james <james@mansionfamily.plus.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Peter Eisentraut <peter_e@gmx.net>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch Andrew Dunstan <andrew@dunslane.net>
Re: json api WIP patch Merlin Moncure <mmoncure@gmail.com>
Re: json api WIP patch Pavel Stehule <pavel.stehule@gmail.com>
On Tue, Jan 15, 2013 at 1:04 PM, David Fetter  wrote:
> On Mon, Jan 14, 2013 at 07:52:56PM -0500, Andrew Dunstan wrote:
>>
>> On 01/14/2013 07:36 PM, Merlin Moncure wrote:
>> >While testing this I noticed that integer based 'get' routines are
>> >zero based -- was this intentional?  Virtually all other aspects of
>> >SQL are 1 based:
>> >
>> >postgres=# select json_get('[1,2,3]', 1);
>> >  json_get
>> >----------
>> >  2
>> >(1 row)
>> >
>> >postgres=# select json_get('[1,2,3]', 0);
>> >  json_get
>> >----------
>> >  1
>> >(1 row)
>>
>> Yes. it's intentional. SQL arrays might be 1-based by default, but
>> JavaScript arrays are not. JsonPath and similar gadgets treat the
>> arrays as zero-based. I suspect the Json-using community would not
>> thank us for being overly SQL-centric on this - and I say that as
>> someone who has always thought zero based arrays were a major design
>> mistake, responsible for countless off-by-one errors.
>
> Perhaps we could compromise by making arrays 0.5-based.

Well, I'm not prepared to argue with Andrew in this one.  It was
surprising behavior to me, but that's sample size one.

merlin


В списке pgsql-hackers по дате отправления
От: Bruce Momjian
Дата:
От: Robert Haas
Дата:
FAQ