create schema s1;
create schema s2;

create table s1.t1 (
  id serial primary key,
  name text
);

create table s2.t2 (
  t1_id int references s1.t1(id),
  name text
);

insert into s1.t1 (id, name) values
  (nextval('s1.t1_id_seq'), 'a'),
  (nextval('s1.t1_id_seq'), 'b'),
  (nextval('s1.t1_id_seq'), 'c');

insert into s2.t2 (t1_id, name) select id, format('refs s1.t1.id(%s)', id) from s1.t1;

table s1.t1;
table s2.t2;

delete from s1.t1;
