JSONB_BUILD_OBJECT
Builds a JSON object from key–value pairs.
Syntax
JSONB_BUILD_OBJECT(<key1>, <value1>, <key2>, <value2>, …)
The arguments come in pairs: a key, then its value. Numbers stay numbers, text becomes strings, NULL becomes null. Handy for sending data to the application in a single JSON field or gathering several columns into one object.