[SQL] Better way to sort a JSONB array? - Mailing list pgsql-sql

From Michael Moore
Subject [SQL] Better way to sort a JSONB array?
Date
Msg-id CACpWLjOA2G2eW-x_++gFNG_Cwi4UvzZkUjWGSgsVfjgyVPE9Zg@mail.gmail.com
Whole thread Raw
Responses Re: [SQL] Better way to sort a JSONB array?  (Steve Midgley <science@misuse.org>)
Re: [SQL] Better way to sort a JSONB array?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-sql
This works, but surely there is a better way to do it:

 select jsonb_agg(row_to_json(alias)) from 
       (Select * from jsonb_populate_recordset(null::tx_portal, json_table2) order by portal_name) alias 
                                                           into json_table2;

It sorts the json_table2 array in "portal_name" order. 

pgsql-sql by date:

Previous
From: Steve Midgley
Date:
Subject: Re: [SQL] PostgreSQL connection with Android Studio
Next
From: Steve Midgley
Date:
Subject: Re: [SQL] Better way to sort a JSONB array?