As commented under your previous answer, you are running into a "proxy cross join".
I explained it in more detail in this related answer:
Two SQL LEFT JOINS produce incorrect result
Your query should work like this:
SELECT d.created AS data
,c3.segment1
,c4.segment2
,c5.segment3
FROM (
SELECT generate_series('2013-03-25'::date
,'2013-04-01'::date
,interval '1 day')::date AS created
) d
LEFT JOIN (
SELECT created
,sum(classification_indicator_id)::integer AS segment1
FROM classifications
WHERE classification_indicator_id = 3
GROUP BY 1
) c3 USING (created)
LEFT JOIN (
SELECT created
,sum(classification_indicator_id)::integer AS segment2
FROM classifications
WHERE classification_indicator_id = 4
GROUP BY 1
) c4 USING (created)
LEFT JOIN (
SELECT created
,sum(classification_indicator_id)::integer AS segment3
FROM classifications
WHERE classification_indicator_id = 5
GROUP BY 1
) c5 USING (created)
ORDER BY 1;
Assuming that created
is a date
, not a timestamp
.
Or, for an even faster query, since this has become a topic:
SELECT d.created AS data
,count(classification_indicator_id = 3 OR NULL)::int * 3 AS segment1
,count(classification_indicator_id = 4 OR NULL)::int * 4 AS segment2
,count(classification_indicator_id = 5 OR NULL)::int * 5 AS segment3
FROM (
SELECT generate_series('2013-03-25'::date
,'2013-04-01'::date
,interval '1 day')::date AS created
) d
LEFT JOIN classifications c USING (created)
GROUP BY 1
ORDER BY 1;