How to get all dates belonging to a timestamp range
If you move the generate_series() to the FROM clause you can use a WHERE condition to limit the rows:

select t.dt::date
from  tsrange('2019-03-04 10:00'::timestamp, '2019-03-06 20:00'::timestamp) r, 
      generate_series(lower(r), upper(r), '1 day') as t(dt)
where t.dt &lt; case 
                when upper(r) = date_trunc('day', upper(r)) 
                     then upper(r)::date 
                else upper(r)::date + 1 
             end;


dt        
----------
2019-03-04
2019-03-05
2019-03-06


If the upper(r) is at midnight, then the generated date (t.dt) needs to be smaller than upper(r). If it's not, generated date needs to be smaller than the next day after the upper end of the range. 

This query is completely independent of the hour in the actual range.

select t.dt::date
from  tsrange('2019-03-04 00:00'::timestamp, '2019-03-06 00:00'::timestamp) r, 
      generate_series(lower(r), upper(r), '1 day') as t(dt)
where t.dt &lt; case 
                when upper(r) = date_trunc('day', upper(r)) 
                     then upper(r)::date 
                else upper(r)::date + 1 
             end;


dt        
----------
2019-03-04
2019-03-05