From: Bruce Momjian Date: Tue, 21 Dec 2004 01:02:28 +0000 (+0000) Subject: I was recently surprised to find that EXTRACT's day of the week X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=825a6219bb864d6448f5567a02726b2529e61bcc;p=users%2Fbernd%2Fpostgres.git I was recently surprised to find that EXTRACT's day of the week numbering is different than TO_CHAR's ditto. EXTRACT starts at 0==Sunday while TO_CHAR starts at 1==Sunday. A suggestion for two documentation notes is attached as a patch to current CVS HEAD. Troels Arvin --- diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index e336f581c2..b80c000a21 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -4412,6 +4412,13 @@ substring('foobar' from 'o(.)b') o 1230 microseconds = 2.021230 seconds. + + + to_char's day of the week numbering + (see the 'D' formatting pattern) is different from that of the + extract function. + + @@ -5146,6 +5153,11 @@ SELECT EXTRACT(DECADE FROM TIMESTAMP '2001-02-16 20:38:40'); SELECT EXTRACT(DOW FROM TIMESTAMP '2001-02-16 20:38:40'); Result: 5 + + Note that extract's day of the week numbering is + different from that of the to_char function. + +