diff options
author | Alexander Korotkov <akorotkov@postgresql.org> | 2019-09-16 21:02:14 +0300 |
---|---|---|
committer | Alexander Korotkov <akorotkov@postgresql.org> | 2019-09-16 21:14:32 +0300 |
commit | d589f94460c24d9b7ac21887d031818d6e3f354d (patch) | |
tree | 7aa11a30c7b97403b337691763fd689cd1be0afb /doc/src | |
parent | d8122578098d3ff20a9a12d25807e56cecac673c (diff) | |
download | postgresql-d589f94460c24d9b7ac21887d031818d6e3f354d.tar.gz postgresql-d589f94460c24d9b7ac21887d031818d6e3f354d.zip |
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
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 24 |
1 files changed, 24 insertions, 0 deletions
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 @@ -6151,6 +6151,30 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}'); <entry>microsecond (000000-999999)</entry> </row> <row> + <entry><literal>FF1</literal></entry> + <entry>tenth of second (0-9)</entry> + </row> + <row> + <entry><literal>FF2</literal></entry> + <entry>hundredth of second (00-99)</entry> + </row> + <row> + <entry><literal>FF3</literal></entry> + <entry>millisecond (000-999)</entry> + </row> + <row> + <entry><literal>FF4</literal></entry> + <entry>tenth of a millisecond (0000-9999)</entry> + </row> + <row> + <entry><literal>FF5</literal></entry> + <entry>hundredth of a millisecond (00000-99999)</entry> + </row> + <row> + <entry><literal>FF6</literal></entry> + <entry>microsecond (000000-999999)</entry> + </row> + <row> <entry><literal>SSSS</literal></entry> <entry>seconds past midnight (0-86399)</entry> </row> |