2038.diff

text/x-patch

Filename: 2038.diff
Type: text/x-patch
Part: 0
Message: Re: Macros for time magic values

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/utils/adt/nabstime.c 1 1
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index 0e25c5f..3cf4166 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -178,7 +178,7 @@ tm2abstime(struct pg_tm * tm, int tz)
 	AbsoluteTime sec;
 
 	/* validate, before going out of range on some members */
-	if (tm->tm_year < 1901 || tm->tm_year > 2038 ||
+	if (tm->tm_year < UTIME_MINYEAR || tm->tm_year > UTIME_MAXYEAR ||
 		tm->tm_mon < 1 || tm->tm_mon > 12 ||
 		tm->tm_mday < 1 || tm->tm_mday > 31 ||
 		tm->tm_hour < 0 ||