Re: jsonb_set array append hack?

From: Thom Brown <thom(at)linux(dot)com>
To: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb_set array append hack?
Date: 2015-09-20 16:50:16
Message-ID: CAA-aLv71yF95r4gennLoWkytsa+SYPX_JA7isdDQH4O9xR-sJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 20 September 2015 at 16:17, Dmitry Dolgov <9erthalion6(at)gmail(dot)com> wrote:

> I'm sorry, but I'm not sure, what behavior is expected in this case?
> Right now the following logic was implemented:
> "we trying to set an element inside an array, but we've got a
> non-integer path item
> ("nonsense" in this particular case), so we're going to add a new
> element at the end of array by default"
>
> If it's wrong, should we refuse to perform such kind of operations, or
> should we replace
> "vehicle_type": ["car", "van"]
> to
> "vehicle_type: {"nonsense": "motorcycle"}
> ?
>

(please bottom-post)

I would expect some kind of error. We're trying to address a position in
an array, and we're instead passing a key. If it completes successfully,
the chances are it isn't what the user intended.

Thom

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2015-09-20 16:53:07 Re: Inaccurate results from numeric ln(), log(), exp() and pow()
Previous Message Dmitry Dolgov 2015-09-20 15:17:00 Re: jsonb_set array append hack?