In PostgreSQL, it is possible to create an array with elements (https://www.postgresql.org/docs/current/functions-array.html):
SELECT ARRAY[1,2,3,4] AS indexes;
Is there a function to generate an array by specifying begin and end? like
SELECT array_from_to(1, 4) AS indexes