pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Support for FF1-FF6 datetime format patterns
Date: Mon, 16 Sep 2019 18:16:46 +0000
Message-ID: <E1i9vYM-0000Pb-WA@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d589f94460c24d9b7ac21887d031818d6e3f354d

Modified Files
--------------
doc/src/sgml/func.sgml                    | 24 ++++++++
src/backend/utils/adt/formatting.c        | 99 ++++++++++++++++++++++++-------
src/backend/utils/adt/timestamp.c         |  3 +-
src/include/utils/datetime.h              |  2 +
src/test/regress/expected/horology.out    | 79 ++++++++++++++++++++++++
src/test/regress/expected/timestamp.out   | 15 +++++
src/test/regress/expected/timestamptz.out | 15 +++++
src/test/regress/sql/horology.sql         |  9 +++
src/test/regress/sql/timestamp.sql        |  8 +++
src/test/regress/sql/timestamptz.sql      |  8 +++
10 files changed, 239 insertions(+), 23 deletions(-)



Message-ID: <E1i9vYM-0000Pb-WA@gemulon.postgresql.org>
Permalink:  ../E1i9vYM-0000Pb-WA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1i9vYM-0000Pb-WA@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org
  Subject: Re: pgsql: Support for FF1-FF6 datetime format patterns
  In-Reply-To: <E1i9vYM-0000Pb-WA@gemulon.postgresql.org>
  References: <E1i9vYM-0000Pb-WA@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox