Skip to content

Commit 1a1ad63

Browse files
committed
date_recv should accept infinities.
Reported by James William Pye.
1 parent 9529f4d commit 1a1ad63

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/utils/adt/date.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.150 2010/01/02 16:57:53 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.151 2010/02/18 04:31:16 itagaki Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -208,8 +208,10 @@ date_recv(PG_FUNCTION_ARGS)
208208
result = (DateADT) pq_getmsgint(buf, sizeof(DateADT));
209209

210210
/* Limit to the same range that date_in() accepts. */
211-
if (result < -POSTGRES_EPOCH_JDATE ||
212-
result >= JULIAN_MAX - POSTGRES_EPOCH_JDATE)
211+
if (DATE_NOT_FINITE(result))
212+
/* ok */ ;
213+
else if (result < -POSTGRES_EPOCH_JDATE ||
214+
result >= JULIAN_MAX - POSTGRES_EPOCH_JDATE)
213215
ereport(ERROR,
214216
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
215217
errmsg("date out of range")));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy