4 ms·
Full list of "What's new in PostgreSQL 9.5" - https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.5 https://wiki.postgresql.org/wiki/What%27s_new_in_
by mkobit 11y ago
Full list of "What's new in PostgreSQL 9.5" - https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.5 https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_...
A lot of goodies around JSONB additions. In 9.4, there wasn't much support for updates to JSONB values, but now there will be some support for document-esque operations:
- jsonb || jsonb (concatenate / overwrite) : combine 2 jsonb objects and if there's overlap, values are replaced at the highest level
- jsonb - text / int (remove key / array element) : remove key or an array element
- jsonb #- text[] / int (remove key / array element in path) : remove key/array at path
- jsonb_set function : update value at path
- rosser 11y agoI have some concerns that overwriting keys at the highest level is always the correct behavior for "concatenating" JSONb documents. If you want to merge two keys, rather than overwrite one, you'll need to handle that at the application level.
- kristaps 11y agoPerforming operations in the app is always an option, but it's often faster/simpler to do it in the DB, if it supports what you need. This feature is just one of these potential nice-to-haves.