mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Ooops, no DATE_IS_NOBEGIN/DATE_IS_NOEND in 8.3 or 8.2 ...
I heard the siren call of git cherry-pick, but should have lashed myself to the mast.
This commit is contained in:
@ -331,20 +331,13 @@ date2timestamp_no_overflow(DateADT dateVal)
|
|||||||
{
|
{
|
||||||
double result;
|
double result;
|
||||||
|
|
||||||
if (DATE_IS_NOBEGIN(dateVal))
|
|
||||||
result = -DBL_MAX;
|
|
||||||
else if (DATE_IS_NOEND(dateVal))
|
|
||||||
result = DBL_MAX;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifdef HAVE_INT64_TIMESTAMP
|
#ifdef HAVE_INT64_TIMESTAMP
|
||||||
/* date is days since 2000, timestamp is microseconds since same... */
|
/* date is days since 2000, timestamp is microseconds since same... */
|
||||||
result = dateVal * (double) USECS_PER_DAY;
|
result = dateVal * (double) USECS_PER_DAY;
|
||||||
#else
|
#else
|
||||||
/* date is days since 2000, timestamp is seconds since same... */
|
/* date is days since 2000, timestamp is seconds since same... */
|
||||||
result = dateVal * (double) SECS_PER_DAY;
|
result = dateVal * (double) SECS_PER_DAY;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user