Unix Technical Forum

BUG #2046: defective date_trunc

This is a discussion on BUG #2046: defective date_trunc within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2046 Logged by: Chris Email address: termi@wp.pl PostgreSQL version: 8.0 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:27 AM
Chris
 
Posts: n/a
Default BUG #2046: defective date_trunc


The following bug has been logged online:

Bug reference: 2046
Logged by: Chris
Email address: termi@wp.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"

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:27 AM
Alvaro Herrera
 
Posts: n/a
Default Re: BUG #2046: defective date_trunc

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.

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:27 AM
Bruce Momjian
 
Posts: n/a
Default Re: BUG #2046: defective date_trunc

Chris wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2046
> Logged by: Chris
> Email address: termi@wp.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@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:26 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com