I want to select from the table arrays of integers like this:
[1, 2, 3]
Now in trying something like this:
(SELECT array_to_json(array_agg(row_to_json(s))) FROM(
SELECT specialty FROM talent_specialty WHERE userid = 840 )s);
and this is the record that query is returning
[{"specialty":1},{"specialty":2}]
Table look like this:

[{"specialty":1},{"specialty":2}, ...]and want[1,2,3,...]?