Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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

In response to

pgsql-bugs by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group