I have a table constructed like this :
oid | identifier | value 1 | 10 | 101 2 | 10 | 102 3 | 20 | 201 4 | 20 | 202 5
Here is the code for the requested output.
select identifier, array_agg(value) from ( values (1 , 10 , 101), (2 , 10 , 102), (3 , 20 , 201), (4 , 20 , 202), (5 , 20 , 203) ) as tab (oid, identifier, value) group by identifier order by identifier;