Search Postgresql Archives

Extract data from JSONB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I need some help with extracting data from json.

I have the following jsonb field

modules  
   "accounts":     {"status": true}, 
   "admin":        {"status": true}, 
   "calendar":     {"status": false}, 
   "chat":         {"status": true}, 
   "contacts":     {"status": true}, 
   "dashboard":    {"status": false}, 
   "help":         {"status": true}
}   

How can I convert that into one row each based on status; for example if I only want to have the active modules.

Only true
   
module    | status
----------+-------
accounts  | true
admin     | true
contacts  | true
help      | true

Thanks for any advise

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux