Re: BUG #13845: Incorrect week number - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13845: Incorrect week number
Date
Msg-id 16668.1452006653@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #13845: Incorrect week number  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
List pgsql-bugs
"Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de> writes:
> Scratch that, I'm confused about YYYY format, has to use IYYY instead.

Exactly.  There's no bug here, it's just that you have to use IYYY
together with IW if you want sensible results.

Per the fine manual:

    Caution: While to_date will reject a mixture of Gregorian and ISO
    week-numbering date fields, to_char will not, since output format
    specifications like YYYY-MM-DD (IYYY-IDDD) can be useful. But avoid
    writing something like IYYY-MM-DD; that would yield surprising results
    near the start of the year.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Feike Steenbergen
Date:
Subject: Re: BUG #13845: Incorrect week number
Next
From:
Date:
Subject: Re: BUG #13822: Slave terminated - WAL contains references to invalid page