The following bug has been logged online:
Bug reference: 5377
Logged by: michel rosa
Email address: mrosa@geomatic.ch
PostgreSQL version: 8.3.10
Operating system: debian
Description: group by problem
Details:
Hello,
I have the following problem
select to_char(upload_date, 'yyyy-mm-dd'),cost,count(cost) from
evadeo.tileshop
where status=2
and source=3
and upload_date>='2010-03-01'
and upload_date<='2010-03-02'
group by to_char(upload_date, 'yyyy-mm-dd'),cost
order by to_char(upload_date, 'yyyy-mm-dd'),cost
give as result
to_char | cost | count
------------+------+-------
2010-03-01 | 0 | 345
2010-03-01 | 0.5 | 38
2010-03-01 | 1 | 9
2010-03-01 | 1.5 | 164
2010-03-02 | 0 | 837
2010-03-02 | 0.5 | 136
2010-03-02 | 1.5 | 138
but when upload_date<='2010-03-03', I get extras rows for 2010-03-02
select to_char(upload_date, 'yyyy-mm-dd'),cost,count(cost) from
evadeo.tileshop
where status=2
and source=3
and upload_date>='2010-03-01'
and upload_date<='2010-03-03'
group by to_char(upload_date, 'yyyy-mm-dd'),cost
order by to_char(upload_date, 'yyyy-mm-dd'),cost
to_char | cost | count
------------+------+-------
2010-03-01 | 0 | 345
2010-03-01 | 0.5 | 38
2010-03-01 | 1 | 9
2010-03-01 | 1.5 | 164
2010-03-02 | 0 | 1217
2010-03-02 | 0.5 | 287
2010-03-02 | 1 | 11894
2010-03-02 | 1.5 | 379
2010-03-02 | 2.0 | 7
2010-03-02 | 3.0 | 3
2010-03-03 | 0 | 7393
2010-03-03 | 0.5 | 85
2010-03-03 | 1.5 | 152
do you have an explication ?
Is it really a bug ?
thanks