Re: jsonb_set array append hack?

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: jsonb_set array append hack?
Дата
Msg-id 560074F5.6060705@dunslane.net
обсуждение исходный текст
Ответ на Re: jsonb_set array append hack?  (Dmitry Dolgov <9erthalion6@gmail.com>)
Ответы Re: jsonb_set array append hack?  (Thom Brown <thom@linux.com>)
Re: jsonb_set array append hack?  (Peter Geoghegan <pg@heroku.com>)
Список pgsql-hackers

On 09/21/2015 12:13 PM, Dmitry Dolgov wrote:
> > 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.
>
> Thanks for the explanation. So, basically, it should be like this, am 
> I right?
>
> postgres=# SELECT jsonb_set(
>     '{"name": "Joe", "vehicle_types": ["car", "van"]}'::jsonb,
>     '{vehicle_types, nonsense}',
>     '"motorcycle"', true);
> ERROR:  path element at the position 2 is not an integer


That seems reasonable. For that matter, we should probably disallow NULL 
path elements also, shouldn't we?

cheers

andrew



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

Предыдущее
От: Dmitry Vasilyev
Дата:
Сообщение: Re: Streaming Replication clusters and load balancing
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Streaming Replication clusters and load balancing