insert into foo(a) with recursive t(n) AS (SELECT 10 AS n UNION ALLSELECT n-1 FROM t WHERE n > 0) select n from t;
works on 8.5
-- GJ