简体   繁体   中英

PostgreSQL: Does jsonb sort Objects in array?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM