Re: BUG #17667: to_char is used to collect statistics by week

From: Japin Li <japinli(at)hotmail(dot)com>
To: 1310290931(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17667: to_char is used to collect statistics by week
Date: 2022-10-27 12:59:18
Message-ID: MEYP282MB1669DCA946F290B96F633CBBB6339@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On Thu, 27 Oct 2022 at 20:43, PG Bug reporting form <noreply(at)postgresql(dot)org> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 17667
> Logged by: 高成 卫
> Email address: 1310290931(at)qq(dot)com
> PostgreSQL version: 14.1
> Operating system: PostgreSQL 14.1 on x86_64-pc-linux-musl, compiled
> Description:
>
> Week 42 of 2022 is October 17-23
>
> When I used ww to format the time, the 23rd was counted to week 43
>
> When I used IW to format the time, the 23rd was counted to the 42nd week

The documentation about Template Patterns for Date/Time Formatting [1]
already descried this:

WW week number of year (1–53) (the first week starts on the first day of the year)
IW week number of ISO 8601 week-numbering year (01–53; the first Thursday of the year is in week 1)

[1] https://www.postgresql.org/docs/current/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIME-TABLE

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-10-27 13:22:34 Re: BUG #17666: Unexpected shutdown
Previous Message Julien Rouhaud 2022-10-27 12:58:36 Re: BUG #17665: pg_stat_statements useless with variable number of parameters in IN close