PostgreSQL: Does jsonb sort Objects in array?

xXx_Hacker_xXx

Example: [{3},{1},{2}]. Does it sort it? [{1},{2}, {3}]

I was confused because of this answer? https://stackoverflow.com/a/49833552/15502607

  1. JSON maintains the order in which elements are inserted, while JSONB maintains the "sorted" order.
ruohola

No, the point in the answer was about the order of the keys in a JSONB object. JSONB arrays maintain the order of their elements in the insertion order.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

PostgreSQL query on a JSONB Array of Objects

Postgresql query array of objects in JSONB field

Can PostgreSQL JOIN on jsonb array objects?

Update array of objects in JSONB format PostgreSQL

PostgreSQL - Add key to each objects of an JSONB array

How to sort objects in an array inside a json or jsonb value by a property of the objects?

How to merge a JSONB array of objects into a single object in PostgreSQL

limit amount of objects in array of postgresql jsonb_agg

Postgresql get keys from array of objects in JSONB field

Postgresql get keys from nested array of objects in JSONB field

How to iterate over PostgreSQL jsonb array of objects and modify elements?

insert jsonb data in postgresql, option array or objects, valid way

Search by date in array of objects within PostgreSQL JSONB Column

Update the value of an attribute in a postgresql jsonb array of objects across muliple records

Postgresql remove object from jsonb array of objects by key value

PostgreSQL indexing JSONB array

Postgresql join on jsonb array

Searching jsonb array in PostgreSQL

postgresql like in an array of jsonb

Querying an array of objects in JSONB

postgresql return the count of jsonb objects

PostgreSQL compare two jsonb objects

Postgresql migrate data from jsonb array to jsonb

Postgresql update JSONB object to array

Edit fields of a jsonb array in postgresql

Searching nested jsonb array in PostgreSQL

Postgresql JSONB object column to Array

Query jsonb array in POSTGRESQL 9.6

How to update PostgreSQL array of jsonb