Re: Odd sum() problem in 7.2.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: andreas(at)sparcy(dot)net (Andreas Forsgren), pgsql-general(at)postgresql(dot)org
Subject: Re: Odd sum() problem in 7.2.2
Date: 2002-10-04 17:36:36
Message-ID: 24878.1033752996@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton <dev(at)archonet(dot)com> writes:
> Nothing changed but different numbers of rows returned? Best look at the where
> clause...

> Hmm - "datetime" - tell me sir, are you in a timezone other than Greenwich and
> if you specify timezones explicitly does the problem go away?

It looks to me like 7.2 has a bug in
abstime-to-timestamp-without-time-zone conversion, which is what that
datetime() thing is invoking. In 7.2.3, running in US EST5EDT zone,
I see:

regression=# select abstime '2002-09-01';
abstime
------------------------
2002-09-01 00:00:00-04
(1 row)

regression=# select (abstime '2002-09-01')::timestamp without time zone;
timestamp
---------------------
2002-09-01 08:00:00
^^ !!!
(1 row)

regression=# select (abstime '2002-09-01')::timestamp with time zone;
timestamptz
------------------------
2002-09-01 00:00:00-04
(1 row)

In 7.3beta I get more sensible results:

regression=# select (abstime '2002-09-01')::timestamp without time zone;
timestamp
---------------------
2002-09-01 00:00:00
(1 row)

so I'd say Thomas fixed the bug while he was working on the datetime
types this summer ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-10-04 17:44:10 Re: transactions
Previous Message Roland Roberts 2002-10-04 17:35:31 Re: [GENERAL] Fast Deletion For Large Tables