I would recommend either an actual array (array_agg function) or a structured string (string_agg function)
SELECT road, array_agg(colA ORDER BY seg)
FROM tbl
GROUP BY road;
Otherwise you will need a output 31 columns with unused columns holding null. You can do that brute-force or you can leverage the tablefunc extension's crosstab function.