

create table test(t text collate pg_c_utf8);
create index test_idx on test ((lower(t)));
insert into test values(U&'\A7DC');

create table tuniq(t text collate pg_c_utf8);
create unique index tuniq_idx on tuniq((lower(t)));
insert into tuniq values(U&'\019B');
insert into tuniq values(U&'\A7DC');

create table tcheck(t text collate pg_c_utf8, check(lower(t) = t));
insert into tcheck values(U&'\A7DC');

create table tpart(t text collate pg_c_utf8, i int) partition by range(lower(t));
create index tpart_idx on tpart ((lower(t)));
create table tpart0 partition of tpart for values from (U&'\0001') to (U&'\8000');
create table tpart1 partition of tpart for values from (U&'\8000') to (U&'\FFFF');
insert into tpart select U&'\1000' || g::text from generate_series(1,500000) g;
insert into tpart select U&'\7000' || g::text from generate_series(1,500000) g;
insert into tpart select U&'\9000' || g::text from generate_series(1,500000) g;
insert into tpart values(U&'\A7DC');
insert into tpart select U&'\E000' || g::text from generate_series(1,500000) g;

vacuum analyze;
