From d589f94460c24d9b7ac21887d031818d6e3f354d Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Mon, 16 Sep 2019 21:02:14 +0300 Subject: Support for FF1-FF6 datetime format patterns SQL Standard 2016 defines FF1-FF9 format patters for fractions of seconds in jsonpath .datetime() method and CAST (... FORMAT ...) SQL clause. Parsing engine of upcoming .datetime() method will be shared with to_date()/ to_timestamp(). This patch implements FF1-FF6 format patterns for upcoming jsonpath .datetime() method. to_date()/to_timestamp() functions will also get support of this format patterns as positive side effect. FF7-FF9 are not supported due to lack of precision in our internal timestamp representation. Extracted from original patch by Nikita Glukhov, Teodor Sigaev, Oleg Bartunov. Heavily revised by me. Discussion: https://postgr.es/m/fcc6fc6a-b497-f39a-923d-aa34d0c588e8%402ndQuadrant.com Discussion: https://postgr.es/m/CAPpHfdsZgYEra_PeCLGNoXOWYx6iU-S3wF8aX0ObQUcZU%2B4XTw%40mail.gmail.com Author: Nikita Glukhov, Teodor Sigaev, Oleg Bartunov, Alexander Korotkov Reviewed-by: Anastasia Lubennikova, Peter Eisentraut --- doc/src/sgml/func.sgml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index cdf41ddef44..9a61f276747 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -6150,6 +6150,30 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}'); US microsecond (000000-999999) + + FF1 + tenth of second (0-9) + + + FF2 + hundredth of second (00-99) + + + FF3 + millisecond (000-999) + + + FF4 + tenth of a millisecond (0000-9999) + + + FF5 + hundredth of a millisecond (00000-99999) + + + FF6 + microsecond (000000-999999) + SSSS seconds past midnight (0-86399) -- cgit v1.2.3