BUG #5377: group by problem - Mailing list pgsql-bugs

From michel rosa
Subject BUG #5377: group by problem
Date
Msg-id 201003181037.o2IAbluQ029864@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5377: group by problem  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: BUG #5377: group by problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: "lsasha"
Date:
Subject: BUG #5378: Little inaccuracy in the manual
Next
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5377: group by problem