Re: BUG #17667: to_char is used to collect statistics by week - Mailing list pgsql-bugs

From Japin Li
Subject Re: BUG #17667: to_char is used to collect statistics by week
Date
Msg-id MEYP282MB1669DCA946F290B96F633CBBB6339@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Whole thread Raw
In response to BUG #17667: to_char is used to collect statistics by week  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Thu, 27 Oct 2022 at 20:43, PG Bug reporting form <noreply@postgresql.org> wrote:
> The following bug has been logged on the website:
>
> Bug reference:      17667
> Logged by:          高成 卫
> Email address:      1310290931@qq.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.



pgsql-bugs by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: BUG #17665: pg_stat_statements useless with variable number of parameters in IN close
Next
From: Tom Lane
Date:
Subject: Re: BUG #17666: Unexpected shutdown