BUG #1653: Bug in date - Mailing list pgsql-bugs

From Guilherme
Subject BUG #1653: Bug in date
Date
Msg-id 20050506193722.20DA4F0B03@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #1653: Bug in date
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1653
Logged by:          Guilherme
Email address:      guilherme.silva@nexxera.com
PostgreSQL version: 7.4
Operating system:   Linux
Description:        Bug in date
Details:

Dear Postgres Support,

I think found a bug in postgres, see the sql:

BILHETAGEM=# select sum(tm_arquivo) from bilhete where
cd_caixa_postal_principal=1304 AND
BILHETAGEM-# dt_transacao >= to_date('01042005000000', 'ddmmyyyyHH24MISS')
AND
BILHETAGEM-# dt_transacao < to_date('02042005000000', 'ddmmyyyyHH24MISS');
sum
-----
968
(1 row)

BILHETAGEM=# select sum(tm_arquivo) from bilhete where
cd_caixa_postal_principal=1304 AND
BILHETAGEM-# dt_transacao >= to_date('01042005000000', 'ddmmyyyyHH24MISS')
AND
BILHETAGEM-# dt_transacao <= to_date('01042005235959', 'ddmmyyyyHH24MISS');
sum
-----

(1 row)

Look the rows number, all the information is on 01/04/2005, but only the
first sql can get the correct results.

I'm brazilian sorry for my bad english.

[]'s

pgsql-bugs by date:

Previous
From: "Villiam Manera"
Date:
Subject: BUG #1652: pg_restore failed
Next
From: Tom Lane
Date:
Subject: Re: BUG #1651: static date field is not recognized automatically when group by is used