diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-06-09 01:11:16 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-06-09 01:11:16 +0000 |
commit | ae526b407039dd743eb318a9f05eba1ee7594738 (patch) | |
tree | 2858f9b0426a2054b81350e36562ea9d2ba0ab39 /src/backend/utils/adt/selfuncs.c | |
parent | 20ad43b576d9360b0e9ce9bd868c989443cf9d36 (diff) | |
download | postgresql-ae526b407039dd743eb318a9f05eba1ee7594738.tar.gz postgresql-ae526b407039dd743eb318a9f05eba1ee7594738.zip |
Another round of updates for new fmgr, mostly in the datetime code.
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 18 |
1 files changed, 10 insertions, 8 deletions
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. |