break;
case TIMESTAMPOID:
- val1 = date2timestamp_opt_error(val1, have_error);
+ val1 = TimestampGetDatum(date2timestamp_opt_error(DatumGetDateADT(val1), have_error));
if (have_error && *have_error)
return 0;
cmpfunc = timestamp_cmp;
errmsg("cannot convert value from %s to %s without timezone usage",
"date", "timestamptz"),
errhint("use *_tz() function for timezone support")));
- val1 = date2timestamptz_opt_error(val1, have_error);
+ val1 = TimestampTzGetDatum(date2timestamptz_opt_error(DatumGetDateADT(val1), have_error));
if (have_error && *have_error)
return 0;
cmpfunc = timestamp_cmp;
switch (typid2)
{
case DATEOID:
- val2 = date2timestamp_opt_error(val2, have_error);
+ val2 = TimestampGetDatum(date2timestamp_opt_error(DatumGetDateADT(val2), have_error));
if (have_error && *have_error)
return 0;
cmpfunc = timestamp_cmp;
errmsg("cannot convert value from %s to %s without timezone usage",
"timestamp", "timestamptz"),
errhint("use *_tz() function for timezone support")));
- val1 = timestamp2timestamptz_opt_error(val1, have_error);
+ val1 = TimestampTzGetDatum(timestamp2timestamptz_opt_error(DatumGetTimestamp(val1), have_error));
if (have_error && *have_error)
return 0;
cmpfunc = timestamp_cmp;
errmsg("cannot convert value from %s to %s without timezone usage",
"date", "timestamptz"),
errhint("use *_tz() function for timezone support")));
- val2 = date2timestamptz_opt_error(val2, have_error);
+ val2 = TimestampTzGetDatum(date2timestamptz_opt_error(DatumGetDateADT(val2), have_error));
if (have_error && *have_error)
return 0;
cmpfunc = timestamp_cmp;
errmsg("cannot convert value from %s to %s without timezone usage",
"timestamp", "timestamptz"),
errhint("use *_tz() function for timezone support")));
- val2 = timestamp2timestamptz_opt_error(val2, have_error);
+ val2 = TimestampTzGetDatum(timestamp2timestamptz_opt_error(DatumGetTimestamp(val2), have_error));
if (have_error && *have_error)
return 0;
cmpfunc = timestamp_cmp;