Re: [BUGS] BUG #1749: date_trunc('week', ...) is incorrect for some

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Nick Johnson <arachnid(at)notdot(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #1749: date_trunc('week', ...) is incorrect for some
Date: 2005-07-04 14:13:43
Message-ID: 200507041413.j64EDhd05231@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

Nick Johnson wrote:
>
> The following bug has been logged online:
>
> Bug reference: 1749
> Logged by: Nick Johnson
> Email address: arachnid(at)notdot(dot)net
> PostgreSQL version: 8.0.3
> Operating system: FreeBSD
> Description: date_trunc('week', ...) is incorrect for some dates
> Details:
>
> numa=# SELECT date_trunc('week', '2002-12-31'::date);
> date_trunc
> ------------------------
> 2001-12-31 00:00:00-05
> (1 row)
>
> Obviously this isn't the expected behaviour...

Thanks, patch attached and applied to CVS HEAD and 8.0.X. When we fixed
January dates that were part of the previous year, I thought their might
be December dates in the next year, but I couldn't find any so I figured
they didn't exist.

--
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

Attachment Content-Type Size
unknown_filename text/plain 1.3 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-07-04 14:27:10 Re: Select on pkey returned more than one row
Previous Message Garrett Heaver 2005-07-04 13:52:56 BUG #1751: pg_restore bug

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-07-04 14:19:32 Re: [PATCHES] [PATCH] pgcrypto: pgp_encrypt v3
Previous Message Dave Page 2005-07-04 14:11:23 Re: [HACKERS] Dbsize backend integration