INSERT INTO king_pilot.date_lookup
SELECT dt::DATE, CASE WHEN EXTRACT('isodow' FROM dt)::INT < 6 THEN 'Weekday' ELSE 'Weekend' END , CASE WHEN holiday IS NOT NULL THEN 'Excluded' ELSE 'Pilot' END
FROM generate_series('2019-01-01'::DATE, '2019-12-31'::DATE, INTERVAL '1 Day') dates(dt)
LEFT OUTER JOIN ref.holiday USING(dt)