>
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