Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading