test=*# select min(generate_series) from (select * from id right join (select * from generate_Series(1, (select max(i) from id))) foo on id.i=foo.generate_series) bla wherei is NULL;
min
-----
1
(1 row)
Time: 9,395 ms
test=*# select max(generate_series) from (select * from id right join (select * from generate_Series(1, (select max(i) from id))) foo on id.i=foo.generate_series) bla wherei is NULL;
max
-----
14
(1 row)