create table calendar c as
(cal_date date primary key,
business_day boolean not null);
insert into calendar
(select
('01/01/1900'::date + (g||' days')::interval)::date,
case extract(dow from '01/01/1900'::date
+ (g||' days')::interval)
when 0 then false when 6 then false else true end
from generate_series(0,365*150) g)
Now you have a calendar table populated with weekends set to "business_day=false" and all other days set to true.
You'll have to populate your other holidays manually or write a program to do that.
Afterwards, to calculate difference between days do something like:
select count(*) from cal
where cal between "start_date_var" and "end_date_var"
and business_day=true;
NOTE: If it were me, I'd add a few other columns to your calendar table so that it can include which holiday it is, or other things like that. May even have another table for holidays. This is a good start though.