I have the following problem:
I have a table with N columns, but I would like to make almost all of them into a single column of type json, eg:
id,
json(col2,col3,col4) as dados
I looked at the documentation, and found a command that does something like that on the whole table:
SELECT
array_to_json(array_agg(tab_1))
FROM
tab_1
Does anyone have any idea how I can solve this?