Skip to content

Commit bbb2e21

Browse files
committed
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
1 parent 93b808e commit bbb2e21

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

doc/src/sgml/func.sgml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.230 2004/12/13 18:05:08 petere Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.231 2004/12/21 01:02:28 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -4412,6 +4412,13 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
44124412
1230 microseconds = 2.021230 seconds.
44134413
</para>
44144414
</listitem>
4415+
4416+
<listitem>
4417+
<para><function>to_char</function>'s day of the week numbering
4418+
(see the 'D' formatting pattern) is different from that of the
4419+
<function>extract</function> function.
4420+
</para>
4421+
</listitem>
44154422
</itemizedlist>
44164423
</para>
44174424

@@ -5146,6 +5153,11 @@ SELECT EXTRACT(DECADE FROM TIMESTAMP '2001-02-16 20:38:40');
51465153
SELECT EXTRACT(DOW FROM TIMESTAMP '2001-02-16 20:38:40');
51475154
<lineannotation>Result: </lineannotation><computeroutput>5</computeroutput>
51485155
</screen>
5156+
<para>
5157+
Note that <function>extract</function>'s day of the week numbering is
5158+
different from that of the <function>to_char</function> function.
5159+
</para>
5160+
51495161
</listitem>
51505162
</varlistentry>
51515163

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy