Skip to content

Commit 9b5fab1

Browse files
author
Nikita Glukhov
committed
Preliminary datetime infrastructure
1 parent afc4a78 commit 9b5fab1

File tree

13 files changed

+639
-34
lines changed

13 files changed

+639
-34
lines changed

doc/src/sgml/func.sgml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5989,6 +5989,30 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}');
59895989
US
59905990
microsecond (000000-999999)
59915991
5992+
5993+
FF1
5994+
decisecond (0-9)
5995+
5996+
5997+
FF2
5998+
centisecond (00-99)
5999+
6000+
6001+
FF3
6002+
millisecond (000-999)
6003+
6004+
6005+
FF4
6006+
tenth of a millisecond (0000-9999)
6007+
6008+
6009+
FF5
6010+
hundredth of a millisecond (00000-99999)
6011+
6012+
6013+
FF6
6014+
microsecond (000000-999999)
6015+
59926016
59936017
SSSS
59946018
seconds past midnight (0-86399)

src/backend/utils/adt/date.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
#endif
4141

4242

43-
static int tm2time(struct pg_tm *tm, fsec_t fsec, TimeADT *result);
44-
static int tm2timetz(struct pg_tm *tm, fsec_t fsec, int tz, TimeTzADT *result);
45-
static void AdjustTimeForTypmod(TimeADT *time, int32 typmod);
46-
47-
4843
/* common code for timetypmodin and timetztypmodin */
4944
static int32
5045
anytime_typmodin(bool istz, ArrayType *ta)
@@ -1210,7 +1205,7 @@ time_in(PG_FUNCTION_ARGS)
12101205
/* tm2time()
12111206
* Convert a tm structure to a time data type.
12121207
*/
1213-
static int
1208+
int
12141209
tm2time(struct pg_tm *tm, fsec_t fsec, TimeADT *result)
12151210
{
12161211
*result = ((((tm->tm_hour * MINS_PER_HOUR + tm->tm_min) * SECS_PER_MINUTE) + tm->tm_sec)
@@ -1376,7 +1371,7 @@ time_scale(PG_FUNCTION_ARGS)
13761371
* have a fundamental tie together but rather a coincidence of
13771372
* implementation. - thomas
13781373
*/
1379-
static void
1374+
void
13801375
AdjustTimeForTypmod(TimeADT *time, int32 typmod)
13811376
{
13821377
static const int64 TimeScales[MAX_TIME_PRECISION + 1] = {
@@ -1954,7 +1949,7 @@ time_part(PG_FUNCTION_ARGS)
19541949
/* tm2timetz()
19551950
* Convert a tm structure to a time data type.
19561951
*/
1957-
static int
1952+
int
19581953
tm2timetz(struct pg_tm *tm, fsec_t fsec, int tz, TimeTzADT *result)
19591954
{
19601955
result->time = ((((tm->tm_hour * MINS_PER_HOUR + tm->tm_min) * SECS_PER_MINUTE) + tm->tm_sec) *

0 commit comments

Comments
 (0)