From cbd2811461daf2c6b71d56048b96374cc2d61d64 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 11 Mar 2011 08:17:49 -0500 Subject: [PATCH] Improve extract(day) documentation with interval values. --- doc/src/sgml/func.sgml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 4635cf2bb5..c392109e6d 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -6605,13 +6605,20 @@ SELECT EXTRACT(CENTURY FROM TIMESTAMP '2001-02-16 20:38:40'); day - The day (of the month) field (1 - 31) + For timestamp values, the day (of the month) field + (1 - 31) ; for interval values, the number of days SELECT EXTRACT(DAY FROM TIMESTAMP '2001-02-16 20:38:40'); Result: 16 + +SELECT EXTRACT(DAY FROM INTERVAL '40 days 1 minute'); +Result: 40 + + + @@ -6827,7 +6834,7 @@ SELECT EXTRACT(MINUTE FROM TIMESTAMP '2001-02-16 20:38:40'); For timestamp values, the number of the month - within the year (1 - 12) ; for interval values + within the year (1 - 12) ; for interval values, the number of months, modulo 12 (0 - 11) -- 2.40.0