You can do it in straight sql like so.
SELECT (array[col1, col2, col3, col4, col5, col6, col7, col8, col9, col10])[i]FROM test t, generate_series(1,10) i
Art