diff options
author | Bruce Momjian <bruce@momjian.us> | 2005-04-01 14:25:39 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2005-04-01 14:25:39 +0000 |
commit | cc20233a8178217da5be1f208ad2bdb84ad7289e (patch) | |
tree | 2a94a5510cc3b2bb7f2f15ec1d07592ea39d70b8 /doc/src | |
parent | ab6853e0b3b9336de856e7f70dfd1cb0b8565f25 (diff) | |
download | postgresql-cc20233a8178217da5be1f208ad2bdb84ad7289e.tar.gz postgresql-cc20233a8178217da5be1f208ad2bdb84ad7289e.zip |
Fix wrong week returnded by date_trunc('week') for early dates in
January --- would return wrong year for 2005-01-01 and 2006-01-01.
per report from Robert Creager.
Backpatch to 8.0.X.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 0403a609884..7a7923a908e 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.234.4.4 2005/03/25 16:08:49 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.234.4.5 2005/04/01 14:25:39 momjian Exp $ PostgreSQL documentation --> @@ -5460,6 +5460,12 @@ SELECT EXTRACT(SECOND FROM TIME '17:12:28.5'); week starts on Monday.) In other words, the first Thursday of a year is in week 1 of that year. (for <type>timestamp</type> values only) </para> + <para> + Because of this, it is possible for early January dates to be part of the + 52nd or 53rd week of the previous year. For example, <literal>2005-01-01</> + is part of the 53rd week of year 2004, and <literal>2006-01-01</> is part of + the 52nd week of year 2005. + </para> <screen> SELECT EXTRACT(WEEK FROM TIMESTAMP '2001-02-16 20:38:40'); |