Re: Support for jsonpath .datetime() method

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Support for jsonpath .datetime() method
Дата
Msg-id a9084f8c-7ff8-bad6-f1cc-1672446b7a75@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Support for jsonpath .datetime() method  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Ответы Re: Support for jsonpath .datetime() method  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
Список pgsql-hackers
I think the best way forward here is to focus first on patch 0002 and
get the additional format templates in, independent of any surrounding
JSON functionality.

In particular, remove parse_datetime() and all the related API changes,
then it becomes much simpler.

The codes FF1..FF6 that you added appear to be correct, but reading the
spec I find there is more missing, specifically

- RRRR and RR
- SSSSS (currently only SSSS is supported, but that's not standard)

Also in some cases we allow timestamps with seven digits of fractional
precision, so perhaps FF7 should be supported as well.  I'm not quite
sure about the details here.  You tests only cover 6 and 9 digits.  It
would be good to cover 7 and perhaps 8 as well, since those are the
boundary cases.

Some concrete pieces of review:

+       <row>
+        <entry><literal>FF1</literal></entry>
+        <entry>decisecond (0-9)</entry>
+       </row>

Let's not use such weird terms as "deciseconds".  We could say
"fractional seconds, 1 digit" etc. or something like that.

+/* Return flags for DCH_from_char() */
+#define DCH_DATED  0x01
+#define DCH_TIMED  0x02
+#define DCH_ZONED  0x04

I think you mean do_to_timestamp() here.  These terms "dated" etc. are
from the SQL standard text, but they should be explained somewhere for
the readers of the code.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Add CREATE DATABASE LOCALE option
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: SQL/JSON: JSON_TABLE