From ae526b407039dd743eb318a9f05eba1ee7594738 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 9 Jun 2000 01:11:16 +0000 Subject: Another round of updates for new fmgr, mostly in the datetime code. --- src/backend/utils/adt/selfuncs.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/backend/utils/adt/selfuncs.c') diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index fb1a77cfbd7..4d0af92ba2b 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.69 2000/06/05 07:28:52 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.70 2000/06/09 01:11:09 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1038,14 +1038,16 @@ convert_timevalue_to_scalar(Datum value, Oid typid) switch (typid) { case TIMESTAMPOID: - return *((Timestamp *) DatumGetPointer(value)); + return DatumGetTimestamp(value); case ABSTIMEOID: - return *abstime_timestamp(value); + return DatumGetTimestamp(DirectFunctionCall1(abstime_timestamp, + value)); case DATEOID: - return *date_timestamp(value); + return DatumGetTimestamp(DirectFunctionCall1(date_timestamp, + value)); case INTERVALOID: { - Interval *interval = (Interval *) DatumGetPointer(value); + Interval *interval = DatumGetIntervalP(value); /* * Convert the month part of Interval to days using @@ -1056,17 +1058,17 @@ convert_timevalue_to_scalar(Datum value, Oid typid) interval->month * (365.25 / 12.0 * 24.0 * 60.0 * 60.0); } case RELTIMEOID: - return (RelativeTime) DatumGetInt32(value); + return DatumGetRelativeTime(value); case TINTERVALOID: { - TimeInterval interval = (TimeInterval) DatumGetPointer(value); + TimeInterval interval = DatumGetTimeInterval(value); if (interval->status != 0) return interval->data[1] - interval->data[0]; return 0; /* for lack of a better idea */ } case TIMEOID: - return *((TimeADT *) DatumGetPointer(value)); + return DatumGetTimeADT(value); } /* Can't get here unless someone tries to use scalarltsel/scalargtsel * on an operator with one timevalue and one non-timevalue operand. -- cgit v1.2.3