From 70007b4dd5e91cc0ea7590b66b38cdf8d2143b15 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 19 Feb 2007 18:20:06 +0000 Subject: [PATCH] Clarify documentation for "day of the week" handling for to_char() and EXTRACT(). --- doc/src/sgml/func.sgml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index ac7a0d1638..1b336ba65d 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -4617,11 +4617,11 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})'); D - day of week (1-7; Sunday is 1) + day of the week, Sunday(1) to Saturday(7) ID - ISO day of week (1-7; Monday is 1) + ISO day of the week, Monday(1) to Sunday(7) W @@ -4844,9 +4844,11 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})'); - to_char's day of the week numbering - (see the 'D' formatting pattern) is different from that of the - extract function. + + to_char(..., 'ID')'s day of the week numbering + matches the extract('isodow', ...) function. + to_char(..., 'D')'s does not match + extract('dow', ...)'s day numbering. @@ -5741,8 +5743,9 @@ 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. + Note that extract's day of the week numbering + is different from that of the to_char(..., + 'D') function. -- 2.40.0