BUG #2046: defective date_trunc

Lists: pgsql-bugs
From: "Chris" <termi(at)wp(dot)pl>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2046: defective date_trunc
Date: 2005-11-15 12:59:48
Message-ID: 20051115125948.86378F0C9D@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2046
Logged by: Chris
Email address: termi(at)wp(dot)pl
PostgreSQL version: 8.0
Operating system: Windows
Description: defective date_trunc
Details:

Postgresql 8.0

select date_trunc('week',TO_DATE('2005-01-01','yyyy-mm-dd'))

result

"2006-01-02 00:00:00+01"


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Chris <termi(at)wp(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2046: defective date_trunc
Date: 2005-11-15 17:16:23
Message-ID: 20051115171623.GH5868@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Chris wrote:

> Postgresql 8.0
>
> select date_trunc('week',TO_DATE('2005-01-01','yyyy-mm-dd'))

Upgrade to 8.0.4. This bug is fixed there.

alvherre=# select date_trunc('week',TO_DATE('2005-01-01','yyyy-mm-dd'));
date_trunc
------------------------
2004-12-27 00:00:00-03
(1 fila)

alvherre=# select version();
version
---------------------------------------------------------------------------------------------------------------
PostgreSQL 8.0.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.2 20050806 (prerelease) (Debian 4.0.1-4)
(1 fila)

alvherre=#

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Chris <termi(at)wp(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2046: defective date_trunc
Date: 2005-11-16 01:32:17
Message-ID: 200511160132.jAG1WHj23624@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Chris wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2046
> Logged by: Chris
> Email address: termi(at)wp(dot)pl
> PostgreSQL version: 8.0
> Operating system: Windows
> Description: defective date_trunc
> Details:
>
> Postgresql 8.0
>
> select date_trunc('week',TO_DATE('2005-01-01','yyyy-mm-dd'))
>
>
> result
>
>
> "2006-01-02 00:00:00+01"

Are you on 8.0.4? If not, you need to upgrade because we fixed this.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073