X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 21DF53A5A44 for ; Mon, 6 Dec 2004 10:22:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71849-06 for ; Mon, 6 Dec 2004 10:22:42 +0000 (GMT) Received: from builder.troels.arvin.dk (rh6builder.fsr.ku.dk [130.225.215.196]) by svr1.postgresql.org (Postfix) with ESMTP id A75D73A5445 for ; Mon, 6 Dec 2004 10:22:43 +0000 (GMT) Received: from localhost (unknown [127.0.0.1]) by builder.troels.arvin.dk (Postfix) with ESMTP id AB99EC040 for ; Mon, 6 Dec 2004 11:22:41 +0100 (CET) Received: from builder.troels.arvin.dk ([127.0.0.1]) by localhost (builder.troels.arvin.dk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09418-08-2 for ; Mon, 6 Dec 2004 11:22:39 +0100 (CET) Received: from 192.168.1.2 (62.79.119.132.adsl.vbr.tiscali.dk [62.79.119.132]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by builder.troels.arvin.dk (Postfix) with ESMTP id AE3FEC03D for ; Mon, 6 Dec 2004 11:22:38 +0100 (CET) Subject: Week numbering From: Troels Arvin To: pgsql-docs@postgresql.org Content-Type: multipart/mixed; boundary="=-0F3bTVuyUU4K60QTCKod" Date: Mon, 06 Dec 2004 11:22:37 +0100 Message-Id: <1102328558.3191.7.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: by amavisd-new at arvin.dk X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.802 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200412/9 X-Sequence-Number: 2705 --=-0F3bTVuyUU4K60QTCKod Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, 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. -- Greetings from Troels Arvin, Copenhagen, Denmark --=-0F3bTVuyUU4K60QTCKod Content-Disposition: attachment; filename=pgsql-day-of-week-docs.patch Content-Type: text/x-patch; name=pgsql-day-of-week-docs.patch; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Index: doc/src/sgml/func.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.229 diff -c -r1.229 func.sgml *** doc/src/sgml/func.sgml 3 Dec 2004 18:34:31 -0000 1.229 --- doc/src/sgml/func.sgml 6 Dec 2004 10:16:57 -0000 *************** *** 4412,4417 **** --- 4412,4424 ---- 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,5151 **** --- 5153,5163 ---- 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. + + --=-0F3bTVuyUU4K60QTCKod--