1
0
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:
Tom Lane
2010-12-28 23:01:33 -05:00
parent 1fa37ac25d
commit 2892fd5dea

View File

@ -331,20 +331,13 @@ date2timestamp_no_overflow(DateADT dateVal)
{
double result;
if (DATE_IS_NOBEGIN(dateVal))
result = -DBL_MAX;
else if (DATE_IS_NOEND(dateVal))
result = DBL_MAX;
else
{
#ifdef HAVE_INT64_TIMESTAMP
/* date is days since 2000, timestamp is microseconds since same... */
result = dateVal * (double) USECS_PER_DAY;
/* date is days since 2000, timestamp is microseconds since same... */
result = dateVal * (double) USECS_PER_DAY;
#else
/* date is days since 2000, timestamp is seconds since same... */
result = dateVal * (double) SECS_PER_DAY;
/* date is days since 2000, timestamp is seconds since same... */
result = dateVal * (double) SECS_PER_DAY;
#endif
}
return result;
}