From 84df54b22e8035addc7108abd9ff6995e8c49264 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 4 Mar 2014 15:09:43 -0300 Subject: Constructors for interval, timestamp, timestamptz MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Pavel Stěhule, editorialized somewhat by Álvaro Herrera Reviewed-by: Tomáš Vondra, Marko Tiikkaja With input from Fabrízio de Royes Mello, Jim Nasby --- doc/src/sgml/func.sgml | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index d344b3a894a..a1f627cbd6c 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -6720,6 +6720,32 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})'); 2013-07-15 + + + + make_interval + + + + make_interval(years int DEFAULT 0, + months int DEFAULT 0, + weeks int DEFAULT 0, + days int DEFAULT 0, + hours int DEFAULT 0, + mins int DEFAULT 0, + secs double precision DEFAULT 0.0) + + + + interval + + Create interval from years, months, weeks, days, hours, minutes and + seconds fields + + make_interval(days := 10) + 10 days + + @@ -6741,6 +6767,57 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})'); 08:15:23.5 + + + + make_timestamp + + + + make_timestamp(year int, + month int, + day int, + hour int, + min int, + sec double precision) + + + + timestamp + + Create timestamp from year, month, day, hour, minute and seconds fields + + make_timestamp(1-23, 7, 15, 8, 15, 23.5) + 2013-07-15 08:15:23.5 + + + + + + make_timestamptz + + + + make_timestamptz(year int, + month int, + day int, + hour int, + min int, + sec double precision, + timezone text ) + + + + timestamp with time zone + + Create timestamp with time zone from year, month, day, hour, minute + and seconds fields. When timezone is not specified, + then current time zone is used. + + make_timestamp(1-23, 7, 15, 8, 15, 23.5) + 2013-07-15 08:15:23.5+01 + + -- cgit v1.2.3