Support for FF1-FF6 datetime format patterns
Alexander Korotkov <akorotkov@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +24 −0 |
| src/backend/utils/adt/formatting.c | modified | +78 −21 |
| src/backend/utils/adt/timestamp.c | modified | +1 −2 |
| src/include/utils/datetime.h | modified | +2 −0 |
| src/test/regress/expected/horology.out | modified | +79 −0 |
| src/test/regress/expected/timestamp.out | modified | +15 −0 |
| src/test/regress/expected/timestamptz.out | modified | +15 −0 |
| src/test/regress/sql/horology.sql | modified | +9 −0 |
| src/test/regress/sql/timestamp.sql | modified | +8 −0 |
| src/test/regress/sql/timestamptz.sql | modified | +8 −0 |
Documentation touched
Discussion
- jsonpath 198 messages · 2018-01-07 → 2019-05-17
- Support for jsonpath .datetime() method 22 messages · 2019-05-28 → 2019-09-27