drop table if exists ref_1 cascade;

create table ref_1 (a int not null primary key) partition by list (a);
create table ref_1_1 (a int not null primary key) partition by list (a);
create table ref_1_1_1 partition of ref_1_1 for values in (1);

alter table ref_1 attach partition ref_1_1 for values in (1);

select pg_catalog.min(100) over (partition by ref_1.a)
  from ref_1 
 where (ref_1.a <= (select foo from generate_series(1, 10) foo order by 1 limit 1)) 
