I am not seeing a solution, but you might see something that would help you.
There is no general solution. For the problem at hand I would union two generate_series(1,5) queries with a query_id column. Then I'd use row_number() over (order by query_id, series_num) to compute the column containing the values 1-10.
Alternatively, use the modulus operator (% 5) on 1-10 to generate the second column.
David J.