Get rows that exist exactly once per day for a given period
select did from foobar2 where 
    date between '2019-01-01' and '2019-01-03' 
    group by did 
    having count(distinct date)=3 and count(date)=3;


If it has at least one of each date, but more than one of some, then count(date) will be > 3.  If it has less than one for some date, then count(distinct date) will be &lt; 3.


  I also wish to get the count, which would be 2 in this case


Figuring out that B and D have a cardinality of 2 seems pretty easy.  Does that really need to be done inside the query?  If so, use a window function

select did, count(*) over () from foobar2 where 
    date between '2019-01-01' and '2019-01-03' 
    group by did 
    having count(distinct date)=3 and count(date)=3;