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.