SET log_error_verbosity = verbose;
drop view if exists v;
drop table if exists r, s cascade;
create table r
(
	a char, 
	b char, 
	ts int, 
	te int
);
create table s
(
	c int, 
	d char, 
	ts int, 
	te int
);
insert into r values
('a','B',1,7), 
('b','B',3,9), 
('c','G',8,10);
insert into s values
(1,'B',2,5), 
(2,'B',3,4), 
(3,'B',7,9);
create view v as
select * from 
(
	r normalize s on r.b=s.d with (ts,te,ts,te)
) x;
select * from v;
 a | b | ts | te 
---+---+----+----
 a | B |  1 |  2
 a | B |  2 |  3
 a | B |  3 |  4
 a | B |  4 |  5
 a | B |  5 |  7
 b | B |  3 |  4
 b | B |  4 |  5
 b | B |  5 |  7
 b | B |  7 |  9
 c | G |  8 | 10
(10 rows)

drop view if exists v;
create materialized view v as
select * from 
(
	r normalize s on r.b=s.d with (ts,te,ts,te)
) x;
select * from v;
 a | b | ts | te 
---+---+----+----
 a | B |  1 |  2
 a | B |  2 |  3
 a | B |  3 |  4
 a | B |  4 |  5
 a | B |  5 |  7
 b | B |  3 |  4
 b | B |  4 |  5
 b | B |  5 |  7
 b | B |  7 |  9
 c | G |  8 | 10
(10 rows)

drop materialized view if exists v;
