From 539579cf7e523467ace66d1afcf52fddfd9522e5 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Mon, 11 Dec 2017 17:34:51 -0800
Subject: [PATCH] Remove out of date types.

Author:
Reviewed-By:
Discussion: https://postgr.es/m/
Backpatch:
---
 doc/src/sgml/brin.sgml                             |   11 -
 doc/src/sgml/catalogs.sgml                         |    4 +-
 doc/src/sgml/datatype.sgml                         |    8 -
 doc/src/sgml/func.sgml                             |   22 -
 doc/src/sgml/ref/create_function.sgml              |    2 +-
 doc/src/sgml/xfunc.sgml                            |   22 +-
 src/backend/access/hash/hashvalidate.c             |    1 -
 src/backend/catalog/system_views.sql               |    2 +-
 src/backend/utils/adt/Makefile                     |    2 +-
 src/backend/utils/adt/date.c                       |   50 -
 src/backend/utils/adt/formatting.c                 |    1 -
 src/backend/utils/adt/nabstime.c                   | 1571 --------------------
 src/backend/utils/adt/selfuncs.c                   |   17 -
 src/bin/pg_dump/pg_dumpall.c                       |    2 +-
 src/include/catalog/pg_aggregate.h                 |    2 -
 src/include/catalog/pg_amop.h                      |   46 -
 src/include/catalog/pg_amproc.h                    |   17 -
 src/include/catalog/pg_cast.h                      |   13 -
 src/include/catalog/pg_opclass.h                   |    7 -
 src/include/catalog/pg_operator.h                  |   65 -
 src/include/catalog/pg_opfamily.h                  |    7 -
 src/include/catalog/pg_proc.h                      |  102 --
 src/include/catalog/pg_type.h                      |   11 -
 src/include/utils/datetime.h                       |    2 +-
 src/include/utils/nabstime.h                       |  103 --
 src/interfaces/ecpg/ecpglib/execute.c              |    6 -
 src/interfaces/ecpg/ecpglib/pg_type.h              |    3 -
 src/interfaces/ecpg/test/expected/thread-thread.c  |    2 +-
 .../ecpg/test/expected/thread-thread_implicit.c    |    2 +-
 src/interfaces/ecpg/test/thread/thread.pgc         |    2 +-
 .../ecpg/test/thread/thread_implicit.pgc           |    2 +-
 src/test/regress/expected/abstime.out              |  136 --
 src/test/regress/expected/alter_table.out          |   30 +-
 src/test/regress/expected/horology.out             |  210 ---
 src/test/regress/expected/opr_sanity.out           |   29 +-
 src/test/regress/expected/reltime.out              |  109 --
 src/test/regress/expected/rules.out                |    2 +-
 src/test/regress/expected/sanity_check.out         |    3 -
 src/test/regress/expected/tinterval.out            |  172 ---
 src/test/regress/expected/triggers.out             |    2 +-
 src/test/regress/parallel_schedule                 |    2 +-
 src/test/regress/serial_schedule                   |    3 -
 src/test/regress/sql/abstime.sql                   |   67 -
 src/test/regress/sql/alter_table.sql               |   24 +-
 src/test/regress/sql/horology.sql                  |   62 -
 src/test/regress/sql/reltime.sql                   |   50 -
 src/test/regress/sql/tinterval.sql                 |   97 --
 src/test/regress/sql/triggers.sql                  |    2 +-
 48 files changed, 35 insertions(+), 3072 deletions(-)
 delete mode 100644 src/backend/utils/adt/nabstime.c
 delete mode 100644 src/include/utils/nabstime.h
 delete mode 100644 src/test/regress/expected/abstime.out
 delete mode 100644 src/test/regress/expected/reltime.out
 delete mode 100644 src/test/regress/expected/tinterval.out
 delete mode 100644 src/test/regress/sql/abstime.sql
 delete mode 100644 src/test/regress/sql/reltime.sql
 delete mode 100644 src/test/regress/sql/tinterval.sql

diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index 23c0e05ed6c..bef1adead53 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -117,17 +117,6 @@
     </row>
    </thead>
    <tbody>
-    <row>
-     <entry><literal>abstime_minmax_ops</literal></entry>
-     <entry><type>abstime</type></entry>
-     <entry>
-      <literal>&lt;</literal>
-      <literal>&lt;=</literal>
-      <literal>=</literal>
-      <literal>&gt;=</literal>
-      <literal>&gt;</literal>
-     </entry>
-    </row>
     <row>
      <entry><literal>int8_minmax_ops</literal></entry>
      <entry><type>bigint</type></entry>
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 3f02202cafb..16140725bb2 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -10558,7 +10558,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
 
      <row>
       <entry><structfield>valuntil</structfield></entry>
-      <entry><type>abstime</type></entry>
+      <entry><type>timestamptz</type></entry>
       <entry></entry>
       <entry>Password expiry time (only used for password authentication)</entry>
      </row>
@@ -11037,7 +11037,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
 
      <row>
       <entry><structfield>valuntil</structfield></entry>
-      <entry><type>abstime</type></entry>
+      <entry><type>timestamptz</type></entry>
       <entry>Password expiry time (only used for password authentication)</entry>
      </row>
 
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 9aa9b28f3e2..0519ca1cfd8 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -1699,14 +1699,6 @@ MINUTE TO SECOND
     any application.
    </para>
 
-   <para>
-    The types <type>abstime</type>
-    and <type>reltime</type> are lower precision types which are used internally.
-    You are discouraged from using these types in
-    applications;  these internal types
-    might disappear in a future release.
-   </para>
-
    <sect2 id="datatype-datetime-input">
     <title>Date/Time Input</title>
 
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 4dd9d029e69..163ca3849c9 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -7314,22 +7314,6 @@ SELECT regexp_match('abc01234xyz', '(?:(.*?)(\d+)(.*)){1,1}');
         <entry></entry>
        </row>
 
-       <row>
-        <entry>
-         <indexterm>
-          <primary>timeofday</primary>
-         </indexterm>
-         <literal><function>timeofday()</function></literal>
-        </entry>
-        <entry><type>text</type></entry>
-        <entry>Current date and time
-         (like <function>clock_timestamp</function>, but as a <type>text</type> string);
-         see <xref linkend="functions-datetime-current"/>
-        </entry>
-        <entry></entry>
-        <entry></entry>
-       </row>
-
        <row>
         <entry>
          <indexterm>
@@ -8155,7 +8139,6 @@ SELECT LOCALTIMESTAMP;
 transaction_timestamp()
 statement_timestamp()
 clock_timestamp()
-timeofday()
 now()
 </synopsis>
    </para>
@@ -8172,11 +8155,6 @@ now()
     differ during subsequent commands.
     <function>clock_timestamp()</function> returns the actual current time, and
     therefore its value changes even within a single SQL command.
-    <function>timeofday()</function> is a historical
-    <productname>PostgreSQL</productname> function.  Like
-    <function>clock_timestamp()</function>, it returns the actual current time,
-    but as a formatted <type>text</type> string rather than a <type>timestamp
-    with time zone</type> value.
     <function>now()</function> is a traditional <productname>PostgreSQL</productname>
     equivalent to <function>transaction_timestamp()</function>.
    </para>
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml
index fd229d11937..c8c2d400e91 100644
--- a/doc/src/sgml/ref/create_function.sgml
+++ b/doc/src/sgml/ref/create_function.sgml
@@ -331,7 +331,7 @@ CREATE [ OR REPLACE ] FUNCTION
        change even within a single table scan, so no optimizations can be
        made.  Relatively few database functions are volatile in this sense;
        some examples are <literal>random()</literal>, <literal>currval()</literal>,
-       <literal>timeofday()</literal>.  But note that any function that has
+       <literal>clock_timestamp()</literal>.  But note that any function that has
        side-effects must be classified volatile, even if its result is quite
        predictable, to prevent calls from being optimized away; an example is
        <literal>setval()</literal>.
diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index bbc3766cc21..24af7061596 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -1542,7 +1542,7 @@ CREATE FUNCTION test(int, int) RETURNS int
     Even a function with no side-effects needs to be labeled
     <literal>VOLATILE</literal> if its value can change within a single query;
     some examples are <literal>random()</literal>, <literal>currval()</literal>,
-    <literal>timeofday()</literal>.
+    <literal>clock_timestamp()</literal>.
    </para>
 
    <para>
@@ -2060,16 +2060,6 @@ memcpy(destination->data, buffer, 40);
         </row>
        </thead>
        <tbody>
-        <row>
-         <entry><type>abstime</type></entry>
-         <entry><type>AbsoluteTime</type></entry>
-         <entry><filename>utils/nabstime.h</filename></entry>
-        </row>
-        <row>
-         <entry><type>bigint</type> (<type>int8</type>)</entry>
-         <entry><type>int64</type></entry>
-         <entry><filename>postgres.h</filename></entry>
-        </row>
         <row>
          <entry><type>boolean</type></entry>
          <entry><type>bool</type></entry>
@@ -2170,11 +2160,6 @@ memcpy(destination->data, buffer, 40);
          <entry><type>regproc</type></entry>
          <entry><filename>postgres.h</filename></entry>
         </row>
-        <row>
-         <entry><type>reltime</type></entry>
-         <entry><type>RelativeTime</type></entry>
-         <entry><filename>utils/nabstime.h</filename></entry>
-        </row>
         <row>
          <entry><type>text</type></entry>
          <entry><type>text*</type></entry>
@@ -2200,11 +2185,6 @@ memcpy(destination->data, buffer, 40);
          <entry><type>Timestamp*</type></entry>
          <entry><filename>datatype/timestamp.h</filename></entry>
         </row>
-        <row>
-         <entry><type>tinterval</type></entry>
-         <entry><type>TimeInterval</type></entry>
-         <entry><filename>utils/nabstime.h</filename></entry>
-        </row>
         <row>
          <entry><type>varchar</type></entry>
          <entry><type>VarChar*</type></entry>
diff --git a/src/backend/access/hash/hashvalidate.c b/src/backend/access/hash/hashvalidate.c
index 8b633c273a5..3428451c76b 100644
--- a/src/backend/access/hash/hashvalidate.c
+++ b/src/backend/access/hash/hashvalidate.c
@@ -311,7 +311,6 @@ check_hash_func_signature(Oid funcid, int16 amprocnum, Oid argtype)
 		 */
 		if ((funcid == F_HASHINT4 || funcid == F_HASHINT4EXTENDED) &&
 			(argtype == DATEOID ||
-			 argtype == ABSTIMEOID || argtype == RELTIMEOID ||
 			 argtype == XIDOID || argtype == CIDOID))
 			 /* okay, allowed use of hashint4() */ ;
 		else if ((funcid == F_TIMESTAMP_HASH ||
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 394aea8e0f5..40bd87888cc 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -41,7 +41,7 @@ CREATE VIEW pg_shadow AS
         rolreplication AS userepl,
         rolbypassrls AS usebypassrls,
         rolpassword AS passwd,
-        rolvaliduntil::abstime AS valuntil,
+        rolvaliduntil AS valuntil,
         setconfig AS useconfig
     FROM pg_authid LEFT JOIN pg_db_role_setting s
     ON (pg_authid.oid = setrole AND setdatabase = 0)
diff --git a/src/backend/utils/adt/Makefile b/src/backend/utils/adt/Makefile
index 1fb018416ef..5d1f6968db3 100644
--- a/src/backend/utils/adt/Makefile
+++ b/src/backend/utils/adt/Makefile
@@ -16,7 +16,7 @@ OBJS = acl.o amutils.o arrayfuncs.o array_expanded.o array_selfuncs.o \
 	float.o format_type.o formatting.o genfile.o \
 	geo_ops.o geo_selfuncs.o geo_spgist.o inet_cidr_ntop.o inet_net_pton.o \
 	int.o int8.o json.o jsonb.o jsonb_gin.o jsonb_op.o jsonb_util.o \
-	jsonfuncs.o like.o lockfuncs.o mac.o mac8.o misc.o nabstime.o name.o \
+	jsonfuncs.o like.o lockfuncs.o mac.o mac8.o misc.o name.o \
 	network.o network_gist.o network_selfuncs.o network_spgist.o \
 	numeric.o numutils.o oid.o oracle_compat.o \
 	orderedsetaggs.o pg_locale.o pg_lsn.o pg_upgrade_support.o \
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index 307b5e86295..c4992bf1f7d 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -29,7 +29,6 @@
 #include "utils/builtins.h"
 #include "utils/date.h"
 #include "utils/datetime.h"
-#include "utils/nabstime.h"
 #include "utils/sortsupport.h"
 
 /*
@@ -1144,55 +1143,6 @@ timestamptz_date(PG_FUNCTION_ARGS)
 }
 
 
-/* abstime_date()
- * Convert abstime to date data type.
- */
-Datum
-abstime_date(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime abstime = PG_GETARG_ABSOLUTETIME(0);
-	DateADT		result;
-	struct pg_tm tt,
-			   *tm = &tt;
-	int			tz;
-
-	switch (abstime)
-	{
-		case INVALID_ABSTIME:
-			ereport(ERROR,
-					(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-					 errmsg("cannot convert reserved abstime value to date")));
-			result = 0;			/* keep compiler quiet */
-			break;
-
-		case NOSTART_ABSTIME:
-			DATE_NOBEGIN(result);
-			break;
-
-		case NOEND_ABSTIME:
-			DATE_NOEND(result);
-			break;
-
-		default:
-			abstime2tm(abstime, &tz, tm, NULL);
-			/* Prevent overflow in Julian-day routines */
-			if (!IS_VALID_JULIAN(tm->tm_year, tm->tm_mon, tm->tm_mday))
-				ereport(ERROR,
-						(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
-						 errmsg("abstime out of range for date")));
-			result = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - POSTGRES_EPOCH_JDATE;
-			/* Now check for just-out-of-range dates */
-			if (!IS_VALID_DATE(result))
-				ereport(ERROR,
-						(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
-						 errmsg("abstime out of range for date")));
-			break;
-	}
-
-	PG_RETURN_DATEADT(result);
-}
-
-
 /*****************************************************************************
  *	 Time ADT
  *****************************************************************************/
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index ec97de0ad27..32781e17122 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -49,7 +49,6 @@
  *	- better number building (formatting) / parsing, now it isn't
  *		  ideal code
  *	- use Assert()
- *	- add support for abstime
  *	- add support for roman number to standard number conversion
  *	- add support for number spelling
  *	- add support for string to string formatting (we must be better
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
deleted file mode 100644
index 2bca39a90cc..00000000000
--- a/src/backend/utils/adt/nabstime.c
+++ /dev/null
@@ -1,1571 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * nabstime.c
- *	  Utilities for the built-in type "AbsoluteTime".
- *	  Functions for the built-in type "RelativeTime".
- *	  Functions for the built-in type "TimeInterval".
- *
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- *
- * IDENTIFICATION
- *	  src/backend/utils/adt/nabstime.c
- *
- *-------------------------------------------------------------------------
- */
-#include "postgres.h"
-
-#include <ctype.h>
-#include <float.h>
-#include <limits.h>
-#include <math.h>
-#include <time.h>
-#include <sys/time.h>
-
-#include "libpq/pqformat.h"
-#include "miscadmin.h"
-#include "utils/builtins.h"
-#include "utils/datetime.h"
-#include "utils/nabstime.h"
-
-#define MIN_DAYNUM (-24856)		/* December 13, 1901 */
-#define MAX_DAYNUM 24854		/* January 18, 2038 */
-
-/*
- * Unix epoch is Jan  1 00:00:00 1970.
- * Postgres knows about times sixty-eight years on either side of that
- * for these 4-byte types.
- *
- * "tinterval" is two 4-byte fields.
- * Definitions for parsing tinterval.
- */
-
-#define IsSpace(C)				((C) == ' ')
-
-#define T_INTERVAL_INVAL   0	/* data represents no valid tinterval */
-#define T_INTERVAL_VALID   1	/* data represents a valid tinterval */
-/*
- * ['Mon May 10 23:59:12 1943 PST' 'Sun Jan 14 03:14:21 1973 PST']
- * 0		1		  2			3		  4			5		  6
- * 1234567890123456789012345678901234567890123456789012345678901234
- *
- * we allocate some extra -- timezones are usually 3 characters but
- * this is not in the POSIX standard...
- */
-#define T_INTERVAL_LEN					80
-#define INVALID_INTERVAL_STR			"Undefined Range"
-#define INVALID_INTERVAL_STR_LEN		(sizeof(INVALID_INTERVAL_STR)-1)
-
-#define ABSTIMEMIN(t1, t2) \
-	(DatumGetBool(DirectFunctionCall2(abstimele, \
-				  AbsoluteTimeGetDatum(t1), \
-				  AbsoluteTimeGetDatum(t2))) ? (t1) : (t2))
-#define ABSTIMEMAX(t1, t2) \
-	(DatumGetBool(DirectFunctionCall2(abstimelt, \
-				  AbsoluteTimeGetDatum(t1), \
-				  AbsoluteTimeGetDatum(t2))) ? (t2) : (t1))
-
-
-/*
- * Function prototypes -- internal to this file only
- */
-
-static AbsoluteTime tm2abstime(struct pg_tm *tm, int tz);
-static void reltime2tm(RelativeTime time, struct pg_tm *tm);
-static void parsetinterval(char *i_string,
-			   AbsoluteTime *i_start,
-			   AbsoluteTime *i_end);
-
-
-/*
- * GetCurrentAbsoluteTime()
- *
- * Get the current system time (relative to Unix epoch).
- *
- * NB: this will overflow in 2038; it should be gone long before that.
- */
-AbsoluteTime
-GetCurrentAbsoluteTime(void)
-{
-	time_t		now;
-
-	now = time(NULL);
-	return (AbsoluteTime) now;
-}
-
-
-void
-abstime2tm(AbsoluteTime _time, int *tzp, struct pg_tm *tm, char **tzn)
-{
-	pg_time_t	time = (pg_time_t) _time;
-	struct pg_tm *tx;
-
-	if (tzp != NULL)
-		tx = pg_localtime(&time, session_timezone);
-	else
-		tx = pg_gmtime(&time);
-
-	tm->tm_year = tx->tm_year + 1900;
-	tm->tm_mon = tx->tm_mon + 1;
-	tm->tm_mday = tx->tm_mday;
-	tm->tm_hour = tx->tm_hour;
-	tm->tm_min = tx->tm_min;
-	tm->tm_sec = tx->tm_sec;
-	tm->tm_isdst = tx->tm_isdst;
-
-	tm->tm_gmtoff = tx->tm_gmtoff;
-	tm->tm_zone = tx->tm_zone;
-
-	if (tzp != NULL)
-	{
-		*tzp = -tm->tm_gmtoff;	/* tm_gmtoff is Sun/DEC-ism */
-
-		/*
-		 * XXX FreeBSD man pages indicate that this should work - tgl 97/04/23
-		 */
-		if (tzn != NULL)
-		{
-			/*
-			 * Copy no more than MAXTZLEN bytes of timezone to tzn, in case it
-			 * contains an error message, which doesn't fit in the buffer
-			 */
-			StrNCpy(*tzn, tm->tm_zone, MAXTZLEN + 1);
-			if (strlen(tm->tm_zone) > MAXTZLEN)
-				ereport(WARNING,
-						(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-						 errmsg("invalid time zone name: \"%s\"",
-								tm->tm_zone)));
-		}
-	}
-	else
-		tm->tm_isdst = -1;
-}
-
-
-/* tm2abstime()
- * Convert a tm structure to abstime.
- * Note that tm has full year (not 1900-based) and 1-based month.
- */
-static AbsoluteTime
-tm2abstime(struct pg_tm *tm, int tz)
-{
-	int			day;
-	AbsoluteTime sec;
-
-	/* validate, before going out of range on some members */
-	if (tm->tm_year < 1901 || tm->tm_year > 2038 ||
-		tm->tm_mon < 1 || tm->tm_mon > MONTHS_PER_YEAR ||
-		tm->tm_mday < 1 || tm->tm_mday > 31 ||
-		tm->tm_hour < 0 ||
-		tm->tm_hour > HOURS_PER_DAY ||	/* test for > 24:00:00 */
-		(tm->tm_hour == HOURS_PER_DAY && (tm->tm_min > 0 || tm->tm_sec > 0)) ||
-		tm->tm_min < 0 || tm->tm_min > MINS_PER_HOUR - 1 ||
-		tm->tm_sec < 0 || tm->tm_sec > SECS_PER_MINUTE)
-		return INVALID_ABSTIME;
-
-	day = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - UNIX_EPOCH_JDATE;
-
-	/* check for time out of range */
-	if (day < MIN_DAYNUM || day > MAX_DAYNUM)
-		return INVALID_ABSTIME;
-
-	/* convert to seconds */
-	sec = tm->tm_sec + tz + (tm->tm_min + (day * HOURS_PER_DAY + tm->tm_hour) * MINS_PER_HOUR) * SECS_PER_MINUTE;
-
-	/*
-	 * check for overflow.  We need a little slop here because the H/M/S plus
-	 * TZ offset could add up to more than 1 day.
-	 */
-	if ((day >= MAX_DAYNUM - 10 && sec < 0) ||
-		(day <= MIN_DAYNUM + 10 && sec > 0))
-		return INVALID_ABSTIME;
-
-	/* check for reserved values (e.g. "current" on edge of usual range */
-	if (!AbsoluteTimeIsReal(sec))
-		return INVALID_ABSTIME;
-
-	return sec;
-}
-
-
-/* abstimein()
- * Decode date/time string and return abstime.
- */
-Datum
-abstimein(PG_FUNCTION_ARGS)
-{
-	char	   *str = PG_GETARG_CSTRING(0);
-	AbsoluteTime result;
-	fsec_t		fsec;
-	int			tz = 0;
-	struct pg_tm date,
-			   *tm = &date;
-	int			dterr;
-	char	   *field[MAXDATEFIELDS];
-	char		workbuf[MAXDATELEN + 1];
-	int			dtype;
-	int			nf,
-				ftype[MAXDATEFIELDS];
-
-	dterr = ParseDateTime(str, workbuf, sizeof(workbuf),
-						  field, ftype, MAXDATEFIELDS, &nf);
-	if (dterr == 0)
-		dterr = DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz);
-	if (dterr != 0)
-		DateTimeParseError(dterr, str, "abstime");
-
-	switch (dtype)
-	{
-		case DTK_DATE:
-			result = tm2abstime(tm, tz);
-			break;
-
-		case DTK_EPOCH:
-
-			/*
-			 * Don't bother retaining this as a reserved value, but instead
-			 * just set to the actual epoch time (1970-01-01)
-			 */
-			result = 0;
-			break;
-
-		case DTK_LATE:
-			result = NOEND_ABSTIME;
-			break;
-
-		case DTK_EARLY:
-			result = NOSTART_ABSTIME;
-			break;
-
-		case DTK_INVALID:
-			result = INVALID_ABSTIME;
-			break;
-
-		default:
-			elog(ERROR, "unexpected dtype %d while parsing abstime \"%s\"",
-				 dtype, str);
-			result = INVALID_ABSTIME;
-			break;
-	};
-
-	PG_RETURN_ABSOLUTETIME(result);
-}
-
-
-/* abstimeout()
- * Given an AbsoluteTime return the English text version of the date
- */
-Datum
-abstimeout(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime time = PG_GETARG_ABSOLUTETIME(0);
-	char	   *result;
-	int			tz;
-	double		fsec = 0;
-	struct pg_tm tt,
-			   *tm = &tt;
-	char		buf[MAXDATELEN + 1];
-	char		zone[MAXDATELEN + 1],
-			   *tzn = zone;
-
-	switch (time)
-	{
-			/*
-			 * Note that timestamp no longer supports 'invalid'. Retain
-			 * 'invalid' for abstime for now, but dump it someday.
-			 */
-		case INVALID_ABSTIME:
-			strcpy(buf, INVALID);
-			break;
-		case NOEND_ABSTIME:
-			strcpy(buf, LATE);
-			break;
-		case NOSTART_ABSTIME:
-			strcpy(buf, EARLY);
-			break;
-		default:
-			abstime2tm(time, &tz, tm, &tzn);
-			EncodeDateTime(tm, fsec, true, tz, tzn, DateStyle, buf);
-			break;
-	}
-
-	result = pstrdup(buf);
-	PG_RETURN_CSTRING(result);
-}
-
-/*
- *		abstimerecv			- converts external binary format to abstime
- */
-Datum
-abstimerecv(PG_FUNCTION_ARGS)
-{
-	StringInfo	buf = (StringInfo) PG_GETARG_POINTER(0);
-
-	PG_RETURN_ABSOLUTETIME((AbsoluteTime) pq_getmsgint(buf, sizeof(AbsoluteTime)));
-}
-
-/*
- *		abstimesend			- converts abstime to binary format
- */
-Datum
-abstimesend(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime time = PG_GETARG_ABSOLUTETIME(0);
-	StringInfoData buf;
-
-	pq_begintypsend(&buf);
-	pq_sendint32(&buf, time);
-	PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
-}
-
-
-/* abstime_finite()
- */
-Datum
-abstime_finite(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime abstime = PG_GETARG_ABSOLUTETIME(0);
-
-	PG_RETURN_BOOL(abstime != INVALID_ABSTIME &&
-				   abstime != NOSTART_ABSTIME &&
-				   abstime != NOEND_ABSTIME);
-}
-
-
-/*
- * abstime comparison routines
- */
-static int
-abstime_cmp_internal(AbsoluteTime a, AbsoluteTime b)
-{
-	/*
-	 * We consider all INVALIDs to be equal and larger than any non-INVALID.
-	 * This is somewhat arbitrary; the important thing is to have a consistent
-	 * sort order.
-	 */
-	if (a == INVALID_ABSTIME)
-	{
-		if (b == INVALID_ABSTIME)
-			return 0;			/* INVALID = INVALID */
-		else
-			return 1;			/* INVALID > non-INVALID */
-	}
-
-	if (b == INVALID_ABSTIME)
-		return -1;				/* non-INVALID < INVALID */
-
-	if (a > b)
-		return 1;
-	else if (a == b)
-		return 0;
-	else
-		return -1;
-}
-
-Datum
-abstimeeq(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	AbsoluteTime t2 = PG_GETARG_ABSOLUTETIME(1);
-
-	PG_RETURN_BOOL(abstime_cmp_internal(t1, t2) == 0);
-}
-
-Datum
-abstimene(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	AbsoluteTime t2 = PG_GETARG_ABSOLUTETIME(1);
-
-	PG_RETURN_BOOL(abstime_cmp_internal(t1, t2) != 0);
-}
-
-Datum
-abstimelt(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	AbsoluteTime t2 = PG_GETARG_ABSOLUTETIME(1);
-
-	PG_RETURN_BOOL(abstime_cmp_internal(t1, t2) < 0);
-}
-
-Datum
-abstimegt(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	AbsoluteTime t2 = PG_GETARG_ABSOLUTETIME(1);
-
-	PG_RETURN_BOOL(abstime_cmp_internal(t1, t2) > 0);
-}
-
-Datum
-abstimele(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	AbsoluteTime t2 = PG_GETARG_ABSOLUTETIME(1);
-
-	PG_RETURN_BOOL(abstime_cmp_internal(t1, t2) <= 0);
-}
-
-Datum
-abstimege(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	AbsoluteTime t2 = PG_GETARG_ABSOLUTETIME(1);
-
-	PG_RETURN_BOOL(abstime_cmp_internal(t1, t2) >= 0);
-}
-
-Datum
-btabstimecmp(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	AbsoluteTime t2 = PG_GETARG_ABSOLUTETIME(1);
-
-	PG_RETURN_INT32(abstime_cmp_internal(t1, t2));
-}
-
-
-/* timestamp_abstime()
- * Convert timestamp to abstime.
- */
-Datum
-timestamp_abstime(PG_FUNCTION_ARGS)
-{
-	Timestamp	timestamp = PG_GETARG_TIMESTAMP(0);
-	AbsoluteTime result;
-	fsec_t		fsec;
-	int			tz;
-	struct pg_tm tt,
-			   *tm = &tt;
-
-	if (TIMESTAMP_IS_NOBEGIN(timestamp))
-		result = NOSTART_ABSTIME;
-	else if (TIMESTAMP_IS_NOEND(timestamp))
-		result = NOEND_ABSTIME;
-	else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL, NULL) == 0)
-	{
-		tz = DetermineTimeZoneOffset(tm, session_timezone);
-		result = tm2abstime(tm, tz);
-	}
-	else
-	{
-		ereport(ERROR,
-				(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
-				 errmsg("timestamp out of range")));
-		result = INVALID_ABSTIME;
-	}
-
-	PG_RETURN_ABSOLUTETIME(result);
-}
-
-/* abstime_timestamp()
- * Convert abstime to timestamp.
- */
-Datum
-abstime_timestamp(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime abstime = PG_GETARG_ABSOLUTETIME(0);
-	Timestamp	result;
-	struct pg_tm tt,
-			   *tm = &tt;
-	int			tz;
-	char		zone[MAXDATELEN + 1],
-			   *tzn = zone;
-
-	switch (abstime)
-	{
-		case INVALID_ABSTIME:
-			ereport(ERROR,
-					(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-					 errmsg("cannot convert abstime \"invalid\" to timestamp")));
-			TIMESTAMP_NOBEGIN(result);
-			break;
-
-		case NOSTART_ABSTIME:
-			TIMESTAMP_NOBEGIN(result);
-			break;
-
-		case NOEND_ABSTIME:
-			TIMESTAMP_NOEND(result);
-			break;
-
-		default:
-			abstime2tm(abstime, &tz, tm, &tzn);
-			if (tm2timestamp(tm, 0, NULL, &result) != 0)
-				ereport(ERROR,
-						(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
-						 errmsg("timestamp out of range")));
-			break;
-	};
-
-	PG_RETURN_TIMESTAMP(result);
-}
-
-
-/* timestamptz_abstime()
- * Convert timestamp with time zone to abstime.
- */
-Datum
-timestamptz_abstime(PG_FUNCTION_ARGS)
-{
-	TimestampTz timestamp = PG_GETARG_TIMESTAMP(0);
-	AbsoluteTime result;
-	fsec_t		fsec;
-	struct pg_tm tt,
-			   *tm = &tt;
-
-	if (TIMESTAMP_IS_NOBEGIN(timestamp))
-		result = NOSTART_ABSTIME;
-	else if (TIMESTAMP_IS_NOEND(timestamp))
-		result = NOEND_ABSTIME;
-	else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL, NULL) == 0)
-		result = tm2abstime(tm, 0);
-	else
-	{
-		ereport(ERROR,
-				(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
-				 errmsg("timestamp out of range")));
-		result = INVALID_ABSTIME;
-	}
-
-	PG_RETURN_ABSOLUTETIME(result);
-}
-
-/* abstime_timestamptz()
- * Convert abstime to timestamp with time zone.
- */
-Datum
-abstime_timestamptz(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime abstime = PG_GETARG_ABSOLUTETIME(0);
-	TimestampTz result;
-	struct pg_tm tt,
-			   *tm = &tt;
-	int			tz;
-	char		zone[MAXDATELEN + 1],
-			   *tzn = zone;
-
-	switch (abstime)
-	{
-		case INVALID_ABSTIME:
-			ereport(ERROR,
-					(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-					 errmsg("cannot convert abstime \"invalid\" to timestamp")));
-			TIMESTAMP_NOBEGIN(result);
-			break;
-
-		case NOSTART_ABSTIME:
-			TIMESTAMP_NOBEGIN(result);
-			break;
-
-		case NOEND_ABSTIME:
-			TIMESTAMP_NOEND(result);
-			break;
-
-		default:
-			abstime2tm(abstime, &tz, tm, &tzn);
-			if (tm2timestamp(tm, 0, &tz, &result) != 0)
-				ereport(ERROR,
-						(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
-						 errmsg("timestamp out of range")));
-			break;
-	};
-
-	PG_RETURN_TIMESTAMP(result);
-}
-
-
-/*****************************************************************************
- *	 USER I/O ROUTINES														 *
- *****************************************************************************/
-
-/*
- *		reltimein		- converts a reltime string in an internal format
- */
-Datum
-reltimein(PG_FUNCTION_ARGS)
-{
-	char	   *str = PG_GETARG_CSTRING(0);
-	RelativeTime result;
-	struct pg_tm tt,
-			   *tm = &tt;
-	fsec_t		fsec;
-	int			dtype;
-	int			dterr;
-	char	   *field[MAXDATEFIELDS];
-	int			nf,
-				ftype[MAXDATEFIELDS];
-	char		workbuf[MAXDATELEN + 1];
-
-	dterr = ParseDateTime(str, workbuf, sizeof(workbuf),
-						  field, ftype, MAXDATEFIELDS, &nf);
-	if (dterr == 0)
-		dterr = DecodeInterval(field, ftype, nf, INTERVAL_FULL_RANGE,
-							   &dtype, tm, &fsec);
-
-	/* if those functions think it's a bad format, try ISO8601 style */
-	if (dterr == DTERR_BAD_FORMAT)
-		dterr = DecodeISO8601Interval(str,
-									  &dtype, tm, &fsec);
-
-	if (dterr != 0)
-	{
-		if (dterr == DTERR_FIELD_OVERFLOW)
-			dterr = DTERR_INTERVAL_OVERFLOW;
-		DateTimeParseError(dterr, str, "reltime");
-	}
-
-	switch (dtype)
-	{
-		case DTK_DELTA:
-			result = ((tm->tm_hour * MINS_PER_HOUR + tm->tm_min) * SECS_PER_MINUTE) + tm->tm_sec;
-			result += tm->tm_year * SECS_PER_YEAR + ((tm->tm_mon * DAYS_PER_MONTH) + tm->tm_mday) * SECS_PER_DAY;
-			break;
-
-		default:
-			elog(ERROR, "unexpected dtype %d while parsing reltime \"%s\"",
-				 dtype, str);
-			result = INVALID_RELTIME;
-			break;
-	}
-
-	PG_RETURN_RELATIVETIME(result);
-}
-
-/*
- *		reltimeout		- converts the internal format to a reltime string
- */
-Datum
-reltimeout(PG_FUNCTION_ARGS)
-{
-	RelativeTime time = PG_GETARG_RELATIVETIME(0);
-	char	   *result;
-	struct pg_tm tt,
-			   *tm = &tt;
-	char		buf[MAXDATELEN + 1];
-
-	reltime2tm(time, tm);
-	EncodeInterval(tm, 0, IntervalStyle, buf);
-
-	result = pstrdup(buf);
-	PG_RETURN_CSTRING(result);
-}
-
-/*
- *		reltimerecv			- converts external binary format to reltime
- */
-Datum
-reltimerecv(PG_FUNCTION_ARGS)
-{
-	StringInfo	buf = (StringInfo) PG_GETARG_POINTER(0);
-
-	PG_RETURN_RELATIVETIME((RelativeTime) pq_getmsgint(buf, sizeof(RelativeTime)));
-}
-
-/*
- *		reltimesend			- converts reltime to binary format
- */
-Datum
-reltimesend(PG_FUNCTION_ARGS)
-{
-	RelativeTime time = PG_GETARG_RELATIVETIME(0);
-	StringInfoData buf;
-
-	pq_begintypsend(&buf);
-	pq_sendint32(&buf, time);
-	PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
-}
-
-
-static void
-reltime2tm(RelativeTime time, struct pg_tm *tm)
-{
-	double		dtime = time;
-
-	FMODULO(dtime, tm->tm_year, 31557600);
-	FMODULO(dtime, tm->tm_mon, 2592000);
-	FMODULO(dtime, tm->tm_mday, SECS_PER_DAY);
-	FMODULO(dtime, tm->tm_hour, SECS_PER_HOUR);
-	FMODULO(dtime, tm->tm_min, SECS_PER_MINUTE);
-	FMODULO(dtime, tm->tm_sec, 1);
-}
-
-
-/*
- *		tintervalin		- converts an tinterval string to internal format
- */
-Datum
-tintervalin(PG_FUNCTION_ARGS)
-{
-	char	   *tintervalstr = PG_GETARG_CSTRING(0);
-	TimeInterval tinterval;
-	AbsoluteTime i_start,
-				i_end,
-				t1,
-				t2;
-
-	parsetinterval(tintervalstr, &t1, &t2);
-
-	tinterval = (TimeInterval) palloc(sizeof(TimeIntervalData));
-
-	if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
-		tinterval->status = T_INTERVAL_INVAL;	/* undefined  */
-	else
-		tinterval->status = T_INTERVAL_VALID;
-
-	i_start = ABSTIMEMIN(t1, t2);
-	i_end = ABSTIMEMAX(t1, t2);
-	tinterval->data[0] = i_start;
-	tinterval->data[1] = i_end;
-
-	PG_RETURN_TIMEINTERVAL(tinterval);
-}
-
-
-/*
- *		tintervalout	- converts an internal tinterval format to a string
- */
-Datum
-tintervalout(PG_FUNCTION_ARGS)
-{
-	TimeInterval tinterval = PG_GETARG_TIMEINTERVAL(0);
-	char	   *i_str,
-			   *p;
-
-	i_str = (char *) palloc(T_INTERVAL_LEN);	/* ["..." "..."] */
-	strcpy(i_str, "[\"");
-	if (tinterval->status == T_INTERVAL_INVAL)
-		strcat(i_str, INVALID_INTERVAL_STR);
-	else
-	{
-		p = DatumGetCString(DirectFunctionCall1(abstimeout,
-												AbsoluteTimeGetDatum(tinterval->data[0])));
-		strcat(i_str, p);
-		pfree(p);
-		strcat(i_str, "\" \"");
-		p = DatumGetCString(DirectFunctionCall1(abstimeout,
-												AbsoluteTimeGetDatum(tinterval->data[1])));
-		strcat(i_str, p);
-		pfree(p);
-	}
-	strcat(i_str, "\"]");
-	PG_RETURN_CSTRING(i_str);
-}
-
-/*
- *		tintervalrecv			- converts external binary format to tinterval
- */
-Datum
-tintervalrecv(PG_FUNCTION_ARGS)
-{
-	StringInfo	buf = (StringInfo) PG_GETARG_POINTER(0);
-	TimeInterval tinterval;
-	int32		status;
-
-	tinterval = (TimeInterval) palloc(sizeof(TimeIntervalData));
-
-	tinterval->status = pq_getmsgint(buf, sizeof(tinterval->status));
-	tinterval->data[0] = pq_getmsgint(buf, sizeof(tinterval->data[0]));
-	tinterval->data[1] = pq_getmsgint(buf, sizeof(tinterval->data[1]));
-
-	if (tinterval->data[0] == INVALID_ABSTIME ||
-		tinterval->data[1] == INVALID_ABSTIME)
-		status = T_INTERVAL_INVAL;	/* undefined  */
-	else
-		status = T_INTERVAL_VALID;
-
-	if (status != tinterval->status)
-		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
-				 errmsg("invalid status in external \"tinterval\" value")));
-
-	PG_RETURN_TIMEINTERVAL(tinterval);
-}
-
-/*
- *		tintervalsend			- converts tinterval to binary format
- */
-Datum
-tintervalsend(PG_FUNCTION_ARGS)
-{
-	TimeInterval tinterval = PG_GETARG_TIMEINTERVAL(0);
-	StringInfoData buf;
-
-	pq_begintypsend(&buf);
-	pq_sendint32(&buf, tinterval->status);
-	pq_sendint32(&buf, tinterval->data[0]);
-	pq_sendint32(&buf, tinterval->data[1]);
-	PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
-}
-
-
-/*****************************************************************************
- *	 PUBLIC ROUTINES														 *
- *****************************************************************************/
-
-Datum
-interval_reltime(PG_FUNCTION_ARGS)
-{
-	Interval   *interval = PG_GETARG_INTERVAL_P(0);
-	RelativeTime time;
-	int			year,
-				month,
-				day;
-	TimeOffset	span;
-
-	year = interval->month / MONTHS_PER_YEAR;
-	month = interval->month % MONTHS_PER_YEAR;
-	day = interval->day;
-
-	span = ((INT64CONST(365250000) * year + INT64CONST(30000000) * month +
-			 INT64CONST(1000000) * day) * INT64CONST(86400)) +
-		interval->time;
-	span /= USECS_PER_SEC;
-
-	if (span < INT_MIN || span > INT_MAX)
-		time = INVALID_RELTIME;
-	else
-		time = span;
-
-	PG_RETURN_RELATIVETIME(time);
-}
-
-
-Datum
-reltime_interval(PG_FUNCTION_ARGS)
-{
-	RelativeTime reltime = PG_GETARG_RELATIVETIME(0);
-	Interval   *result;
-	int			year,
-				month,
-				day;
-
-	result = (Interval *) palloc(sizeof(Interval));
-
-	switch (reltime)
-	{
-		case INVALID_RELTIME:
-			ereport(ERROR,
-					(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-					 errmsg("cannot convert reltime \"invalid\" to interval")));
-			result->time = 0;
-			result->day = 0;
-			result->month = 0;
-			break;
-
-		default:
-			year = reltime / SECS_PER_YEAR;
-			reltime -= year * SECS_PER_YEAR;
-			month = reltime / (DAYS_PER_MONTH * SECS_PER_DAY);
-			reltime -= month * (DAYS_PER_MONTH * SECS_PER_DAY);
-			day = reltime / SECS_PER_DAY;
-			reltime -= day * SECS_PER_DAY;
-
-			result->time = (reltime * USECS_PER_SEC);
-			result->month = MONTHS_PER_YEAR * year + month;
-			result->day = day;
-			break;
-	}
-
-	PG_RETURN_INTERVAL_P(result);
-}
-
-
-/*
- *		mktinterval		- creates a time interval with endpoints t1 and t2
- */
-Datum
-mktinterval(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	AbsoluteTime t2 = PG_GETARG_ABSOLUTETIME(1);
-	AbsoluteTime tstart = ABSTIMEMIN(t1, t2);
-	AbsoluteTime tend = ABSTIMEMAX(t1, t2);
-	TimeInterval tinterval;
-
-	tinterval = (TimeInterval) palloc(sizeof(TimeIntervalData));
-
-	if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
-		tinterval->status = T_INTERVAL_INVAL;
-
-	else
-	{
-		tinterval->status = T_INTERVAL_VALID;
-		tinterval->data[0] = tstart;
-		tinterval->data[1] = tend;
-	}
-
-	PG_RETURN_TIMEINTERVAL(tinterval);
-}
-
-/*
- *		timepl, timemi and abstimemi use the formula
- *				abstime + reltime = abstime
- *		so		abstime - reltime = abstime
- *		and		abstime - abstime = reltime
- */
-
-/*
- *		timepl			- returns the value of (abstime t1 + reltime t2)
- */
-Datum
-timepl(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	RelativeTime t2 = PG_GETARG_RELATIVETIME(1);
-
-	if (AbsoluteTimeIsReal(t1) &&
-		RelativeTimeIsValid(t2) &&
-		((t2 > 0 && t1 < NOEND_ABSTIME - t2) ||
-		 (t2 <= 0 && t1 > NOSTART_ABSTIME - t2)))	/* prevent overflow */
-		PG_RETURN_ABSOLUTETIME(t1 + t2);
-
-	PG_RETURN_ABSOLUTETIME(INVALID_ABSTIME);
-}
-
-
-/*
- *		timemi			- returns the value of (abstime t1 - reltime t2)
- */
-Datum
-timemi(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0);
-	RelativeTime t2 = PG_GETARG_RELATIVETIME(1);
-
-	if (AbsoluteTimeIsReal(t1) &&
-		RelativeTimeIsValid(t2) &&
-		((t2 > 0 && t1 > NOSTART_ABSTIME + t2) ||
-		 (t2 <= 0 && t1 < NOEND_ABSTIME + t2))) /* prevent overflow */
-		PG_RETURN_ABSOLUTETIME(t1 - t2);
-
-	PG_RETURN_ABSOLUTETIME(INVALID_ABSTIME);
-}
-
-
-/*
- *		intinterval		- returns true iff absolute date is in the tinterval
- */
-Datum
-intinterval(PG_FUNCTION_ARGS)
-{
-	AbsoluteTime t = PG_GETARG_ABSOLUTETIME(0);
-	TimeInterval tinterval = PG_GETARG_TIMEINTERVAL(1);
-
-	if (tinterval->status == T_INTERVAL_VALID && t != INVALID_ABSTIME)
-	{
-		if (DatumGetBool(DirectFunctionCall2(abstimege,
-											 AbsoluteTimeGetDatum(t),
-											 AbsoluteTimeGetDatum(tinterval->data[0]))) &&
-			DatumGetBool(DirectFunctionCall2(abstimele,
-											 AbsoluteTimeGetDatum(t),
-											 AbsoluteTimeGetDatum(tinterval->data[1]))))
-			PG_RETURN_BOOL(true);
-	}
-	PG_RETURN_BOOL(false);
-}
-
-/*
- *		tintervalrel		- returns  relative time corresponding to tinterval
- */
-Datum
-tintervalrel(PG_FUNCTION_ARGS)
-{
-	TimeInterval tinterval = PG_GETARG_TIMEINTERVAL(0);
-	AbsoluteTime t1 = tinterval->data[0];
-	AbsoluteTime t2 = tinterval->data[1];
-
-	if (tinterval->status != T_INTERVAL_VALID)
-		PG_RETURN_RELATIVETIME(INVALID_RELTIME);
-
-	if (AbsoluteTimeIsReal(t1) &&
-		AbsoluteTimeIsReal(t2))
-		PG_RETURN_RELATIVETIME(t2 - t1);
-
-	PG_RETURN_RELATIVETIME(INVALID_RELTIME);
-}
-
-
-/*
- *		timenow			- returns  time "now", internal format
- *
- *		Now AbsoluteTime is time since Jan 1 1970 -mer 7 Feb 1992
- */
-Datum
-timenow(PG_FUNCTION_ARGS)
-{
-	PG_RETURN_ABSOLUTETIME(GetCurrentAbsoluteTime());
-}
-
-/*
- * reltime comparison routines
- */
-static int
-reltime_cmp_internal(RelativeTime a, RelativeTime b)
-{
-	/*
-	 * We consider all INVALIDs to be equal and larger than any non-INVALID.
-	 * This is somewhat arbitrary; the important thing is to have a consistent
-	 * sort order.
-	 */
-	if (a == INVALID_RELTIME)
-	{
-		if (b == INVALID_RELTIME)
-			return 0;			/* INVALID = INVALID */
-		else
-			return 1;			/* INVALID > non-INVALID */
-	}
-
-	if (b == INVALID_RELTIME)
-		return -1;				/* non-INVALID < INVALID */
-
-	if (a > b)
-		return 1;
-	else if (a == b)
-		return 0;
-	else
-		return -1;
-}
-
-Datum
-reltimeeq(PG_FUNCTION_ARGS)
-{
-	RelativeTime t1 = PG_GETARG_RELATIVETIME(0);
-	RelativeTime t2 = PG_GETARG_RELATIVETIME(1);
-
-	PG_RETURN_BOOL(reltime_cmp_internal(t1, t2) == 0);
-}
-
-Datum
-reltimene(PG_FUNCTION_ARGS)
-{
-	RelativeTime t1 = PG_GETARG_RELATIVETIME(0);
-	RelativeTime t2 = PG_GETARG_RELATIVETIME(1);
-
-	PG_RETURN_BOOL(reltime_cmp_internal(t1, t2) != 0);
-}
-
-Datum
-reltimelt(PG_FUNCTION_ARGS)
-{
-	RelativeTime t1 = PG_GETARG_RELATIVETIME(0);
-	RelativeTime t2 = PG_GETARG_RELATIVETIME(1);
-
-	PG_RETURN_BOOL(reltime_cmp_internal(t1, t2) < 0);
-}
-
-Datum
-reltimegt(PG_FUNCTION_ARGS)
-{
-	RelativeTime t1 = PG_GETARG_RELATIVETIME(0);
-	RelativeTime t2 = PG_GETARG_RELATIVETIME(1);
-
-	PG_RETURN_BOOL(reltime_cmp_internal(t1, t2) > 0);
-}
-
-Datum
-reltimele(PG_FUNCTION_ARGS)
-{
-	RelativeTime t1 = PG_GETARG_RELATIVETIME(0);
-	RelativeTime t2 = PG_GETARG_RELATIVETIME(1);
-
-	PG_RETURN_BOOL(reltime_cmp_internal(t1, t2) <= 0);
-}
-
-Datum
-reltimege(PG_FUNCTION_ARGS)
-{
-	RelativeTime t1 = PG_GETARG_RELATIVETIME(0);
-	RelativeTime t2 = PG_GETARG_RELATIVETIME(1);
-
-	PG_RETURN_BOOL(reltime_cmp_internal(t1, t2) >= 0);
-}
-
-Datum
-btreltimecmp(PG_FUNCTION_ARGS)
-{
-	RelativeTime t1 = PG_GETARG_RELATIVETIME(0);
-	RelativeTime t2 = PG_GETARG_RELATIVETIME(1);
-
-	PG_RETURN_INT32(reltime_cmp_internal(t1, t2));
-}
-
-
-/*
- *		tintervalsame	- returns true iff tinterval i1 is same as tinterval i2
- *		Check begin and end time.
- */
-Datum
-tintervalsame(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	if (i1->status == T_INTERVAL_INVAL || i2->status == T_INTERVAL_INVAL)
-		PG_RETURN_BOOL(false);
-
-	if (DatumGetBool(DirectFunctionCall2(abstimeeq,
-										 AbsoluteTimeGetDatum(i1->data[0]),
-										 AbsoluteTimeGetDatum(i2->data[0]))) &&
-		DatumGetBool(DirectFunctionCall2(abstimeeq,
-										 AbsoluteTimeGetDatum(i1->data[1]),
-										 AbsoluteTimeGetDatum(i2->data[1]))))
-		PG_RETURN_BOOL(true);
-	PG_RETURN_BOOL(false);
-}
-
-/*
- * tinterval comparison routines
- *
- * Note: comparison is based only on the lengths of the tintervals, not on
- * endpoint values (as long as they're not INVALID).  This is pretty bogus,
- * but since it's only a legacy datatype, we're not going to change it.
- *
- * Some other bogus things that won't be changed for compatibility reasons:
- * 1. The interval length computations overflow at 2^31 seconds, causing
- * intervals longer than that to sort oddly compared to those shorter.
- * 2. infinity and minus infinity (NOEND_ABSTIME and NOSTART_ABSTIME) are
- * just ordinary integers.  Since this code doesn't handle them specially,
- * it's possible for [a b] to be considered longer than [c infinity] for
- * finite abstimes a, b, c.  In combination with the previous point, the
- * interval [-infinity infinity] is treated as being shorter than many finite
- * intervals :-(
- *
- * If tinterval is ever reimplemented atop timestamp, it'd be good to give
- * some consideration to avoiding these problems.
- */
-static int
-tinterval_cmp_internal(TimeInterval a, TimeInterval b)
-{
-	bool		a_invalid;
-	bool		b_invalid;
-	AbsoluteTime a_len;
-	AbsoluteTime b_len;
-
-	/*
-	 * We consider all INVALIDs to be equal and larger than any non-INVALID.
-	 * This is somewhat arbitrary; the important thing is to have a consistent
-	 * sort order.
-	 */
-	a_invalid = a->status == T_INTERVAL_INVAL ||
-		a->data[0] == INVALID_ABSTIME ||
-		a->data[1] == INVALID_ABSTIME;
-	b_invalid = b->status == T_INTERVAL_INVAL ||
-		b->data[0] == INVALID_ABSTIME ||
-		b->data[1] == INVALID_ABSTIME;
-
-	if (a_invalid)
-	{
-		if (b_invalid)
-			return 0;			/* INVALID = INVALID */
-		else
-			return 1;			/* INVALID > non-INVALID */
-	}
-
-	if (b_invalid)
-		return -1;				/* non-INVALID < INVALID */
-
-	a_len = a->data[1] - a->data[0];
-	b_len = b->data[1] - b->data[0];
-
-	if (a_len > b_len)
-		return 1;
-	else if (a_len == b_len)
-		return 0;
-	else
-		return -1;
-}
-
-Datum
-tintervaleq(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) == 0);
-}
-
-Datum
-tintervalne(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) != 0);
-}
-
-Datum
-tintervallt(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) < 0);
-}
-
-Datum
-tintervalle(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) <= 0);
-}
-
-Datum
-tintervalgt(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) > 0);
-}
-
-Datum
-tintervalge(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) >= 0);
-}
-
-Datum
-bttintervalcmp(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	PG_RETURN_INT32(tinterval_cmp_internal(i1, i2));
-}
-
-
-/*
- *		tintervalleneq	- returns true iff length of tinterval i is equal to
- *								reltime t
- *		tintervallenne	- returns true iff length of tinterval i is not equal
- *								to reltime t
- *		tintervallenlt	- returns true iff length of tinterval i is less than
- *								reltime t
- *		tintervallengt	- returns true iff length of tinterval i is greater
- *								than reltime t
- *		tintervallenle	- returns true iff length of tinterval i is less or
- *								equal than reltime t
- *		tintervallenge	- returns true iff length of tinterval i is greater or
- *								equal than reltime t
- */
-Datum
-tintervalleneq(PG_FUNCTION_ARGS)
-{
-	TimeInterval i = PG_GETARG_TIMEINTERVAL(0);
-	RelativeTime t = PG_GETARG_RELATIVETIME(1);
-	RelativeTime rt;
-
-	if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME)
-		PG_RETURN_BOOL(false);
-	rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel,
-												  TimeIntervalGetDatum(i)));
-	PG_RETURN_BOOL(rt != INVALID_RELTIME && rt == t);
-}
-
-Datum
-tintervallenne(PG_FUNCTION_ARGS)
-{
-	TimeInterval i = PG_GETARG_TIMEINTERVAL(0);
-	RelativeTime t = PG_GETARG_RELATIVETIME(1);
-	RelativeTime rt;
-
-	if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME)
-		PG_RETURN_BOOL(false);
-	rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel,
-												  TimeIntervalGetDatum(i)));
-	PG_RETURN_BOOL(rt != INVALID_RELTIME && rt != t);
-}
-
-Datum
-tintervallenlt(PG_FUNCTION_ARGS)
-{
-	TimeInterval i = PG_GETARG_TIMEINTERVAL(0);
-	RelativeTime t = PG_GETARG_RELATIVETIME(1);
-	RelativeTime rt;
-
-	if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME)
-		PG_RETURN_BOOL(false);
-	rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel,
-												  TimeIntervalGetDatum(i)));
-	PG_RETURN_BOOL(rt != INVALID_RELTIME && rt < t);
-}
-
-Datum
-tintervallengt(PG_FUNCTION_ARGS)
-{
-	TimeInterval i = PG_GETARG_TIMEINTERVAL(0);
-	RelativeTime t = PG_GETARG_RELATIVETIME(1);
-	RelativeTime rt;
-
-	if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME)
-		PG_RETURN_BOOL(false);
-	rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel,
-												  TimeIntervalGetDatum(i)));
-	PG_RETURN_BOOL(rt != INVALID_RELTIME && rt > t);
-}
-
-Datum
-tintervallenle(PG_FUNCTION_ARGS)
-{
-	TimeInterval i = PG_GETARG_TIMEINTERVAL(0);
-	RelativeTime t = PG_GETARG_RELATIVETIME(1);
-	RelativeTime rt;
-
-	if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME)
-		PG_RETURN_BOOL(false);
-	rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel,
-												  TimeIntervalGetDatum(i)));
-	PG_RETURN_BOOL(rt != INVALID_RELTIME && rt <= t);
-}
-
-Datum
-tintervallenge(PG_FUNCTION_ARGS)
-{
-	TimeInterval i = PG_GETARG_TIMEINTERVAL(0);
-	RelativeTime t = PG_GETARG_RELATIVETIME(1);
-	RelativeTime rt;
-
-	if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME)
-		PG_RETURN_BOOL(false);
-	rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel,
-												  TimeIntervalGetDatum(i)));
-	PG_RETURN_BOOL(rt != INVALID_RELTIME && rt >= t);
-}
-
-/*
- *		tintervalct		- returns true iff tinterval i1 contains tinterval i2
- */
-Datum
-tintervalct(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	if (i1->status == T_INTERVAL_INVAL || i2->status == T_INTERVAL_INVAL)
-		PG_RETURN_BOOL(false);
-	if (DatumGetBool(DirectFunctionCall2(abstimele,
-										 AbsoluteTimeGetDatum(i1->data[0]),
-										 AbsoluteTimeGetDatum(i2->data[0]))) &&
-		DatumGetBool(DirectFunctionCall2(abstimege,
-										 AbsoluteTimeGetDatum(i1->data[1]),
-										 AbsoluteTimeGetDatum(i2->data[1]))))
-		PG_RETURN_BOOL(true);
-	PG_RETURN_BOOL(false);
-}
-
-/*
- *		tintervalov		- returns true iff tinterval i1 (partially) overlaps i2
- */
-Datum
-tintervalov(PG_FUNCTION_ARGS)
-{
-	TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0);
-	TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1);
-
-	if (i1->status == T_INTERVAL_INVAL || i2->status == T_INTERVAL_INVAL)
-		PG_RETURN_BOOL(false);
-	if (DatumGetBool(DirectFunctionCall2(abstimelt,
-										 AbsoluteTimeGetDatum(i1->data[1]),
-										 AbsoluteTimeGetDatum(i2->data[0]))) ||
-		DatumGetBool(DirectFunctionCall2(abstimegt,
-										 AbsoluteTimeGetDatum(i1->data[0]),
-										 AbsoluteTimeGetDatum(i2->data[1]))))
-		PG_RETURN_BOOL(false);
-	PG_RETURN_BOOL(true);
-}
-
-/*
- *		tintervalstart	- returns  the start of tinterval i
- */
-Datum
-tintervalstart(PG_FUNCTION_ARGS)
-{
-	TimeInterval i = PG_GETARG_TIMEINTERVAL(0);
-
-	if (i->status == T_INTERVAL_INVAL)
-		PG_RETURN_ABSOLUTETIME(INVALID_ABSTIME);
-	PG_RETURN_ABSOLUTETIME(i->data[0]);
-}
-
-/*
- *		tintervalend		- returns  the end of tinterval i
- */
-Datum
-tintervalend(PG_FUNCTION_ARGS)
-{
-	TimeInterval i = PG_GETARG_TIMEINTERVAL(0);
-
-	if (i->status == T_INTERVAL_INVAL)
-		PG_RETURN_ABSOLUTETIME(INVALID_ABSTIME);
-	PG_RETURN_ABSOLUTETIME(i->data[1]);
-}
-
-
-/*****************************************************************************
- *	 PRIVATE ROUTINES														 *
- *****************************************************************************/
-
-/*
- *		parsetinterval -- parse a tinterval string
- *
- *		output parameters:
- *				i_start, i_end: tinterval margins
- *
- *		Time interval:
- *		`[' {` '} `'' <AbsTime> `'' {` '} `'' <AbsTime> `'' {` '} `]'
- *
- *		OR	`Undefined Range'	(see also INVALID_INTERVAL_STR)
- *
- *		where <AbsTime> satisfies the syntax of absolute time.
- *
- *		e.g.  [  '  Jan 18 1902'   'Jan 1 00:00:00 1970']
- */
-static void
-parsetinterval(char *i_string,
-			   AbsoluteTime *i_start,
-			   AbsoluteTime *i_end)
-{
-	char	   *p,
-			   *p1;
-	char		c;
-
-	p = i_string;
-	/* skip leading blanks up to '[' */
-	while ((c = *p) != '\0')
-	{
-		if (IsSpace(c))
-			p++;
-		else if (c != '[')
-			goto bogus;			/* syntax error */
-		else
-			break;
-	}
-	if (c == '\0')
-		goto bogus;				/* syntax error */
-	p++;
-	/* skip leading blanks up to '"' */
-	while ((c = *p) != '\0')
-	{
-		if (IsSpace(c))
-			p++;
-		else if (c != '"')
-			goto bogus;			/* syntax error */
-		else
-			break;
-	}
-	if (c == '\0')
-		goto bogus;				/* syntax error */
-	p++;
-	if (strncmp(INVALID_INTERVAL_STR, p, strlen(INVALID_INTERVAL_STR)) == 0)
-		goto bogus;				/* undefined range, handled like a syntax err. */
-	/* search for the end of the first date and change it to a \0 */
-	p1 = p;
-	while ((c = *p1) != '\0')
-	{
-		if (c == '"')
-			break;
-		p1++;
-	}
-	if (c == '\0')
-		goto bogus;				/* syntax error */
-	*p1 = '\0';
-	/* get the first date */
-	*i_start = DatumGetAbsoluteTime(DirectFunctionCall1(abstimein,
-														CStringGetDatum(p)));
-	/* undo change to \0 */
-	*p1 = c;
-	p = ++p1;
-	/* skip blanks up to '"', beginning of second date */
-	while ((c = *p) != '\0')
-	{
-		if (IsSpace(c))
-			p++;
-		else if (c != '"')
-			goto bogus;			/* syntax error */
-		else
-			break;
-	}
-	if (c == '\0')
-		goto bogus;				/* syntax error */
-	p++;
-	/* search for the end of the second date and change it to a \0 */
-	p1 = p;
-	while ((c = *p1) != '\0')
-	{
-		if (c == '"')
-			break;
-		p1++;
-	}
-	if (c == '\0')
-		goto bogus;				/* syntax error */
-	*p1 = '\0';
-	/* get the second date */
-	*i_end = DatumGetAbsoluteTime(DirectFunctionCall1(abstimein,
-													  CStringGetDatum(p)));
-	/* undo change to \0 */
-	*p1 = c;
-	p = ++p1;
-	/* skip blanks up to ']' */
-	while ((c = *p) != '\0')
-	{
-		if (IsSpace(c))
-			p++;
-		else if (c != ']')
-			goto bogus;			/* syntax error */
-		else
-			break;
-	}
-	if (c == '\0')
-		goto bogus;				/* syntax error */
-	p++;
-	c = *p;
-	if (c != '\0')
-		goto bogus;				/* syntax error */
-
-	/* it seems to be a valid tinterval */
-	return;
-
-bogus:
-	ereport(ERROR,
-			(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
-			 errmsg("invalid input syntax for type %s: \"%s\"",
-					"tinterval", i_string)));
-	*i_start = *i_end = INVALID_ABSTIME;	/* keep compiler quiet */
-}
-
-
-/*****************************************************************************
- *
- *****************************************************************************/
-
-/*
- * timeofday -
- *	   returns the current time as a text. similar to timenow() but returns
- *	   seconds with more precision (up to microsecs). (I need this to compare
- *	   the Wisconsin benchmark with Illustra whose TimeNow() shows current
- *	   time with precision up to microsecs.)			  - ay 3/95
- */
-Datum
-timeofday(PG_FUNCTION_ARGS)
-{
-	struct timeval tp;
-	char		templ[128];
-	char		buf[128];
-	pg_time_t	tt;
-
-	gettimeofday(&tp, NULL);
-	tt = (pg_time_t) tp.tv_sec;
-	pg_strftime(templ, sizeof(templ), "%a %b %d %H:%M:%S.%%06d %Y %Z",
-				pg_localtime(&tt, session_timezone));
-	snprintf(buf, sizeof(buf), templ, tp.tv_usec);
-
-	PG_RETURN_TEXT_P(cstring_to_text(buf));
-}
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index ea95b8068d9..9b5eb282897 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -138,7 +138,6 @@
 #include "utils/fmgroids.h"
 #include "utils/index_selfuncs.h"
 #include "utils/lsyscache.h"
-#include "utils/nabstime.h"
 #include "utils/pg_locale.h"
 #include "utils/rel.h"
 #include "utils/selfuncs.h"
@@ -4114,11 +4113,8 @@ convert_to_scalar(Datum value, Oid valuetypid, double *scaledvalue,
 			 */
 		case TIMESTAMPOID:
 		case TIMESTAMPTZOID:
-		case ABSTIMEOID:
 		case DATEOID:
 		case INTERVALOID:
-		case RELTIMEOID:
-		case TINTERVALOID:
 		case TIMEOID:
 		case TIMETZOID:
 			*scaledvalue = convert_timevalue_to_scalar(value, valuetypid);
@@ -4532,9 +4528,6 @@ convert_timevalue_to_scalar(Datum value, Oid typid)
 			return DatumGetTimestamp(value);
 		case TIMESTAMPTZOID:
 			return DatumGetTimestampTz(value);
-		case ABSTIMEOID:
-			return DatumGetTimestamp(DirectFunctionCall1(abstime_timestamp,
-														 value));
 		case DATEOID:
 			return date2timestamp_no_overflow(DatumGetDateADT(value));
 		case INTERVALOID:
@@ -4549,16 +4542,6 @@ convert_timevalue_to_scalar(Datum value, Oid typid)
 				return interval->time + interval->day * (double) USECS_PER_DAY +
 					interval->month * ((DAYS_PER_YEAR / (double) MONTHS_PER_YEAR) * USECS_PER_DAY);
 			}
-		case RELTIMEOID:
-			return (DatumGetRelativeTime(value) * 1000000.0);
-		case TINTERVALOID:
-			{
-				TimeInterval tinterval = DatumGetTimeInterval(value);
-
-				if (tinterval->status != 0)
-					return ((tinterval->data[1] - tinterval->data[0]) * 1000000.0);
-				return 0;		/* for lack of a better idea */
-			}
 		case TIMEOID:
 			return DatumGetTimeADT(value);
 		case TIMETZOID:
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 41c5ff89b75..d259e94f73b 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -812,7 +812,7 @@ dumpRoles(PGconn *conn)
 						  "false as rolcanlogin, "
 						  "-1 as rolconnlimit, "
 						  "null::text as rolpassword, "
-						  "null::abstime as rolvaliduntil, "
+						  "null::timestamptz as rolvaliduntil, "
 						  "false as rolreplication, "
 						  "false as rolbypassrls, "
 						  "null as rolcomment, "
diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h
index 13f1bce5afa..64e99530a8f 100644
--- a/src/include/catalog/pg_aggregate.h
+++ b/src/include/catalog/pg_aggregate.h
@@ -176,7 +176,6 @@ DATA(insert ( 2117	n 0 int2larger		-				int2larger			-	-	-				-				-				f f r r
 DATA(insert ( 2118	n 0 oidlarger		-				oidlarger			-	-	-				-				-				f f r r 610		26		0	0		0	_null_ _null_ ));
 DATA(insert ( 2119	n 0 float4larger	-				float4larger		-	-	-				-				-				f f r r 623		700		0	0		0	_null_ _null_ ));
 DATA(insert ( 2120	n 0 float8larger	-				float8larger		-	-	-				-				-				f f r r 674		701		0	0		0	_null_ _null_ ));
-DATA(insert ( 2121	n 0 int4larger		-				int4larger			-	-	-				-				-				f f r r 563		702		0	0		0	_null_ _null_ ));
 DATA(insert ( 2122	n 0 date_larger		-				date_larger			-	-	-				-				-				f f r r 1097	1082	0	0		0	_null_ _null_ ));
 DATA(insert ( 2123	n 0 time_larger		-				time_larger			-	-	-				-				-				f f r r 1112	1083	0	0		0	_null_ _null_ ));
 DATA(insert ( 2124	n 0 timetz_larger	-				timetz_larger		-	-	-				-				-				f f r r 1554	1266	0	0		0	_null_ _null_ ));
@@ -199,7 +198,6 @@ DATA(insert ( 2133	n 0 int2smaller		-				int2smaller			-	-	-				-				-				f f r
 DATA(insert ( 2134	n 0 oidsmaller		-				oidsmaller			-	-	-				-				-				f f r r 609		26		0	0		0	_null_ _null_ ));
 DATA(insert ( 2135	n 0 float4smaller	-				float4smaller		-	-	-				-				-				f f r r 622		700		0	0		0	_null_ _null_ ));
 DATA(insert ( 2136	n 0 float8smaller	-				float8smaller		-	-	-				-				-				f f r r 672		701		0	0		0	_null_ _null_ ));
-DATA(insert ( 2137	n 0 int4smaller		-				int4smaller			-	-	-				-				-				f f r r 562		702		0	0		0	_null_ _null_ ));
 DATA(insert ( 2138	n 0 date_smaller	-				date_smaller		-	-	-				-				-				f f r r 1095	1082	0	0		0	_null_ _null_ ));
 DATA(insert ( 2139	n 0 time_smaller	-				time_smaller		-	-	-				-				-				f f r r 1110	1083	0	0		0	_null_ _null_ ));
 DATA(insert ( 2140	n 0 timetz_smaller	-				timetz_smaller		-	-	-				-				-				f f r r 1552	1266	0	0		0	_null_ _null_ ));
diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h
index f850be490af..57674c69568 100644
--- a/src/include/catalog/pg_amop.h
+++ b/src/include/catalog/pg_amop.h
@@ -263,16 +263,6 @@ DATA(insert (	428   17 17 3 s 1955	403 0 ));
 DATA(insert (	428   17 17 4 s 1960	403 0 ));
 DATA(insert (	428   17 17 5 s 1959	403 0 ));
 
-/*
- *	btree abstime_ops
- */
-
-DATA(insert (	421   702 702 1 s  562	403 0 ));
-DATA(insert (	421   702 702 2 s  564	403 0 ));
-DATA(insert (	421   702 702 3 s  560	403 0 ));
-DATA(insert (	421   702 702 4 s  565	403 0 ));
-DATA(insert (	421   702 702 5 s  563	403 0 ));
-
 /*
  *	btree datetime_ops
  */
@@ -462,26 +452,6 @@ DATA(insert (	2099   790 790 3 s	900 403 0 ));
 DATA(insert (	2099   790 790 4 s	905 403 0 ));
 DATA(insert (	2099   790 790 5 s	903 403 0 ));
 
-/*
- *	btree reltime_ops
- */
-
-DATA(insert (	2233   703 703 1 s	568 403 0 ));
-DATA(insert (	2233   703 703 2 s	570 403 0 ));
-DATA(insert (	2233   703 703 3 s	566 403 0 ));
-DATA(insert (	2233   703 703 4 s	571 403 0 ));
-DATA(insert (	2233   703 703 5 s	569 403 0 ));
-
-/*
- *	btree tinterval_ops
- */
-
-DATA(insert (	2234   704 704 1 s	813 403 0 ));
-DATA(insert (	2234   704 704 2 s	815 403 0 ));
-DATA(insert (	2234   704 704 3 s	811 403 0 ));
-DATA(insert (	2234   704 704 4 s	816 403 0 ));
-DATA(insert (	2234   704 704 5 s	814 403 0 ));
-
 /*
  *	btree array_ops
  */
@@ -589,10 +559,6 @@ DATA(insert (	2223   17 17 1 s 1955 405 0 ));
 DATA(insert (	2225   28 28 1 s	352 405 0 ));
 /* cid_ops */
 DATA(insert (	2226   29 29 1 s	385 405 0 ));
-/* abstime_ops */
-DATA(insert (	2227   702 702 1 s	560 405 0 ));
-/* reltime_ops */
-DATA(insert (	2228   703 703 1 s	566 405 0 ));
 /* text_pattern_ops */
 DATA(insert (	2229   25 25 1 s	98	405 0 ));
 /* bpchar_pattern_ops */
@@ -993,18 +959,6 @@ DATA(insert (	4070	701  701 3 s	   670	  3580 0 ));
 DATA(insert (	4070	701  701 4 s	   675	  3580 0 ));
 DATA(insert (	4070	701  701 5 s	   674	  3580 0 ));
 
-/* minmax abstime */
-DATA(insert (	4072	702  702 1 s	   562	  3580 0 ));
-DATA(insert (	4072	702  702 2 s	   564	  3580 0 ));
-DATA(insert (	4072	702  702 3 s	   560	  3580 0 ));
-DATA(insert (	4072	702  702 4 s	   565	  3580 0 ));
-DATA(insert (	4072	702  702 5 s	   563	  3580 0 ));
-/* minmax reltime */
-DATA(insert (	4073	703  703 1 s	   568	  3580 0 ));
-DATA(insert (	4073	703  703 2 s	   570	  3580 0 ));
-DATA(insert (	4073	703  703 3 s	   566	  3580 0 ));
-DATA(insert (	4073	703  703 4 s	   571	  3580 0 ));
-DATA(insert (	4073	703  703 5 s	   569	  3580 0 ));
 /* minmax macaddr */
 DATA(insert (	4074	829  829 1 s	  1222	  3580 0 ));
 DATA(insert (	4074	829  829 2 s	  1223	  3580 0 ));
diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h
index 1c958462074..ca893873e22 100644
--- a/src/include/catalog/pg_amproc.h
+++ b/src/include/catalog/pg_amproc.h
@@ -76,7 +76,6 @@ typedef FormData_pg_amproc *Form_pg_amproc;
 
 /* btree */
 DATA(insert (	397   2277 2277 1 382 ));
-DATA(insert (	421   702 702 1 357 ));
 DATA(insert (	423   1560 1560 1 1596 ));
 DATA(insert (	424   16 16 1 1693 ));
 DATA(insert (	426   1042 1042 1 1078 ));
@@ -135,8 +134,6 @@ DATA(insert (	2095   25 25 2 3332 ));
 DATA(insert (	2097   1042 1042 1 2180 ));
 DATA(insert (	2097   1042 1042 2 3333 ));
 DATA(insert (	2099   790 790 1  377 ));
-DATA(insert (	2233   703 703 1  380 ));
-DATA(insert (	2234   704 704 1  381 ));
 DATA(insert (	2789   27 27 1 2794 ));
 DATA(insert (	2968   2950 2950 1 2960 ));
 DATA(insert (	2968   2950 2950 2 3300 ));
@@ -202,10 +199,6 @@ DATA(insert (	2225   28 28 1 450 ));
 DATA(insert (	2225   28 28 2 425));
 DATA(insert (	2226   29 29 1 450 ));
 DATA(insert (	2226   29 29 2 425 ));
-DATA(insert (	2227   702 702 1 450 ));
-DATA(insert (	2227   702 702 2 425 ));
-DATA(insert (	2228   703 703 1 450 ));
-DATA(insert (	2228   703 703 2 425 ));
 DATA(insert (	2229   25 25 1 400 ));
 DATA(insert (	2229   25 25 2 448 ));
 DATA(insert (	2231   1042 1042 1 1080 ));
@@ -427,16 +420,6 @@ DATA(insert (	4070   701	 700  2  3384 ));
 DATA(insert (	4070   701	 700  3  3385 ));
 DATA(insert (	4070   701	 700  4  3386 ));
 
-/* minmax abstime */
-DATA(insert (	4072   702	 702  1  3383 ));
-DATA(insert (	4072   702	 702  2  3384 ));
-DATA(insert (	4072   702	 702  3  3385 ));
-DATA(insert (	4072   702	 702  4  3386 ));
-/* minmax reltime */
-DATA(insert (	4073   703	 703  1  3383 ));
-DATA(insert (	4073   703	 703  2  3384 ));
-DATA(insert (	4073   703	 703  3  3385 ));
-DATA(insert (	4073   703	 703  4  3386 ));
 /* minmax macaddr */
 DATA(insert (	4074   829	 829  1  3383 ));
 DATA(insert (	4074   829	 829  2  3384 ));
diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h
index 17827531ad2..94b94e22d5a 100644
--- a/src/include/catalog/pg_cast.h
+++ b/src/include/catalog/pg_cast.h
@@ -265,32 +265,19 @@ DATA(insert (  3402  25    0 i i ));
 /*
  * Datetime category
  */
-DATA(insert (  702 1082 1179 a f ));
-DATA(insert (  702 1083 1364 a f ));
-DATA(insert (  702 1114 2023 i f ));
-DATA(insert (  702 1184 1173 i f ));
-DATA(insert (  703 1186 1177 i f ));
 DATA(insert ( 1082 1114 2024 i f ));
 DATA(insert ( 1082 1184 1174 i f ));
 DATA(insert ( 1083 1186 1370 i f ));
 DATA(insert ( 1083 1266 2047 i f ));
-DATA(insert ( 1114	702 2030 a f ));
 DATA(insert ( 1114 1082 2029 a f ));
 DATA(insert ( 1114 1083 1316 a f ));
 DATA(insert ( 1114 1184 2028 i f ));
-DATA(insert ( 1184	702 1180 a f ));
 DATA(insert ( 1184 1082 1178 a f ));
 DATA(insert ( 1184 1083 2019 a f ));
 DATA(insert ( 1184 1114 2027 a f ));
 DATA(insert ( 1184 1266 1388 a f ));
-DATA(insert ( 1186	703 1194 a f ));
 DATA(insert ( 1186 1083 1419 a f ));
 DATA(insert ( 1266 1083 2046 a f ));
-/* Cross-category casts between int4 and abstime, reltime */
-DATA(insert (	23	702    0 e b ));
-DATA(insert (  702	 23    0 e b ));
-DATA(insert (	23	703    0 e b ));
-DATA(insert (  703	 23    0 e b ));
 
 /*
  * Geometric category
diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h
index 28dbc747d5b..da477cac58d 100644
--- a/src/include/catalog/pg_opclass.h
+++ b/src/include/catalog/pg_opclass.h
@@ -90,7 +90,6 @@ typedef FormData_pg_opclass *Form_pg_opclass;
  * ----------------
  */
 
-DATA(insert (	403		abstime_ops			PGNSP PGUID  421  702 t 0 ));
 DATA(insert (	403		array_ops			PGNSP PGUID  397 2277 t 0 ));
 DATA(insert (	405		array_ops			PGNSP PGUID  627 2277 t 0 ));
 DATA(insert (	403		bit_ops				PGNSP PGUID  423 1560 t 0 ));
@@ -173,13 +172,9 @@ DATA(insert (	405		bytea_ops			PGNSP PGUID 2223   17 t 0 ));
 DATA(insert (	403		tid_ops				PGNSP PGUID 2789   27 t 0 ));
 DATA(insert (	405		xid_ops				PGNSP PGUID 2225   28 t 0 ));
 DATA(insert (	405		cid_ops				PGNSP PGUID 2226   29 t 0 ));
-DATA(insert (	405		abstime_ops			PGNSP PGUID 2227  702 t 0 ));
-DATA(insert (	405		reltime_ops			PGNSP PGUID 2228  703 t 0 ));
 DATA(insert (	405		text_pattern_ops	PGNSP PGUID 2229   25 f 0 ));
 DATA(insert (	405		varchar_pattern_ops PGNSP PGUID 2229   25 f 0 ));
 DATA(insert (	405		bpchar_pattern_ops	PGNSP PGUID 2231 1042 f 0 ));
-DATA(insert (	403		reltime_ops			PGNSP PGUID 2233  703 t 0 ));
-DATA(insert (	403		tinterval_ops		PGNSP PGUID 2234  704 t 0 ));
 DATA(insert (	405		aclitem_ops			PGNSP PGUID 2235 1033 t 0 ));
 DATA(insert (	783		box_ops				PGNSP PGUID 2593  603 t 0 ));
 DATA(insert (	783		point_ops			PGNSP PGUID 1029  600 t 603 ));
@@ -223,8 +218,6 @@ DATA(insert (	3580	oid_minmax_ops			PGNSP PGUID 4068	26 t 26 ));
 DATA(insert (	3580	tid_minmax_ops			PGNSP PGUID 4069	27 t 27 ));
 DATA(insert (	3580	float4_minmax_ops		PGNSP PGUID 4070   700 t 700 ));
 DATA(insert (	3580	float8_minmax_ops		PGNSP PGUID 4070   701 t 701 ));
-DATA(insert (	3580	abstime_minmax_ops		PGNSP PGUID 4072   702 t 702 ));
-DATA(insert (	3580	reltime_minmax_ops		PGNSP PGUID 4073   703 t 703 ));
 DATA(insert (	3580	macaddr_minmax_ops		PGNSP PGUID 4074   829 t 829 ));
 DATA(insert (	3580	macaddr8_minmax_ops		PGNSP PGUID 4109   774 t 774 ));
 DATA(insert (	3580	inet_minmax_ops			PGNSP PGUID 4075   869 f 869 ));
diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h
index ff9b47077b0..f58700735ee 100644
--- a/src/include/catalog/pg_operator.h
+++ b/src/include/catalog/pg_operator.h
@@ -349,54 +349,6 @@ DATA(insert OID = 558 (  "-"	   PGNSP PGUID l f f	 0	23	23	 0	 0 int4um - - ));
 DESCR("negate");
 DATA(insert OID = 559 (  "-"	   PGNSP PGUID l f f	 0	21	21	 0	 0 int2um - - ));
 DESCR("negate");
-DATA(insert OID = 560 (  "="	   PGNSP PGUID b t t 702 702	16 560 561 abstimeeq eqsel eqjoinsel ));
-DESCR("equal");
-DATA(insert OID = 561 (  "<>"	   PGNSP PGUID b f f 702 702	16 561 560 abstimene neqsel neqjoinsel ));
-DESCR("not equal");
-DATA(insert OID = 562 (  "<"	   PGNSP PGUID b f f 702 702	16 563 565 abstimelt scalarltsel scalarltjoinsel ));
-DESCR("less than");
-DATA(insert OID = 563 (  ">"	   PGNSP PGUID b f f 702 702	16 562 564 abstimegt scalargtsel scalargtjoinsel ));
-DESCR("greater than");
-DATA(insert OID = 564 (  "<="	   PGNSP PGUID b f f 702 702	16 565 563 abstimele scalarlesel scalarlejoinsel ));
-DESCR("less than or equal");
-DATA(insert OID = 565 (  ">="	   PGNSP PGUID b f f 702 702	16 564 562 abstimege scalargesel scalargejoinsel ));
-DESCR("greater than or equal");
-DATA(insert OID = 566 (  "="	   PGNSP PGUID b t t 703 703	16 566 567 reltimeeq eqsel eqjoinsel ));
-DESCR("equal");
-DATA(insert OID = 567 (  "<>"	   PGNSP PGUID b f f 703 703	16 567 566 reltimene neqsel neqjoinsel ));
-DESCR("not equal");
-DATA(insert OID = 568 (  "<"	   PGNSP PGUID b f f 703 703	16 569 571 reltimelt scalarltsel scalarltjoinsel ));
-DESCR("less than");
-DATA(insert OID = 569 (  ">"	   PGNSP PGUID b f f 703 703	16 568 570 reltimegt scalargtsel scalargtjoinsel ));
-DESCR("greater than");
-DATA(insert OID = 570 (  "<="	   PGNSP PGUID b f f 703 703	16 571 569 reltimele scalarlesel scalarlejoinsel ));
-DESCR("less than or equal");
-DATA(insert OID = 571 (  ">="	   PGNSP PGUID b f f 703 703	16 570 568 reltimege scalargesel scalargejoinsel ));
-DESCR("greater than or equal");
-DATA(insert OID = 572 (  "~="	   PGNSP PGUID b f f 704 704	16 572	 0 tintervalsame eqsel eqjoinsel ));
-DESCR("same as");
-DATA(insert OID = 573 (  "<<"	   PGNSP PGUID b f f 704 704	16	 0	 0 tintervalct - - ));
-DESCR("contains");
-DATA(insert OID = 574 (  "&&"	   PGNSP PGUID b f f 704 704	16 574	 0 tintervalov - - ));
-DESCR("overlaps");
-DATA(insert OID = 575 (  "#="	   PGNSP PGUID b f f 704 703	16	 0 576 tintervalleneq - - ));
-DESCR("equal by length");
-DATA(insert OID = 576 (  "#<>"	   PGNSP PGUID b f f 704 703	16	 0 575 tintervallenne - - ));
-DESCR("not equal by length");
-DATA(insert OID = 577 (  "#<"	   PGNSP PGUID b f f 704 703	16	 0 580 tintervallenlt - - ));
-DESCR("less than by length");
-DATA(insert OID = 578 (  "#>"	   PGNSP PGUID b f f 704 703	16	 0 579 tintervallengt - - ));
-DESCR("greater than by length");
-DATA(insert OID = 579 (  "#<="	   PGNSP PGUID b f f 704 703	16	 0 578 tintervallenle - - ));
-DESCR("less than or equal by length");
-DATA(insert OID = 580 (  "#>="	   PGNSP PGUID b f f 704 703	16	 0 577 tintervallenge - - ));
-DESCR("greater than or equal by length");
-DATA(insert OID = 581 (  "+"	   PGNSP PGUID b f f 702 703 702	 0	 0 timepl - - ));
-DESCR("add");
-DATA(insert OID = 582 (  "-"	   PGNSP PGUID b f f 702 703 702	 0	 0 timemi - - ));
-DESCR("subtract");
-DATA(insert OID = 583 (  "<?>"	   PGNSP PGUID b f f 702 704	16	 0	 0 intinterval - - ));
-DESCR("is contained by");
 DATA(insert OID = 584 (  "-"	   PGNSP PGUID l f f	 0 700 700	 0	 0 float4um - - ));
 DESCR("negate");
 DATA(insert OID = 585 (  "-"	   PGNSP PGUID l f f	 0 701 701	 0	 0 float8um - - ));
@@ -425,10 +377,6 @@ DATA(insert OID = 596 (  "|/"	   PGNSP PGUID l f f	 0 701 701	 0	 0 dsqrt - - ))
 DESCR("square root");
 DATA(insert OID = 597 (  "||/"	   PGNSP PGUID l f f	 0 701 701	 0	 0 dcbrt - - ));
 DESCR("cube root");
-DATA(insert OID = 1284 (  "|"	   PGNSP PGUID l f f	 0 704 702	 0	 0 tintervalstart - - ));
-DESCR("start of interval");
-DATA(insert OID = 606 (  "<#>"	   PGNSP PGUID b f f 702 702 704	 0	 0 mktinterval - - ));
-DESCR("convert to tinterval");
 
 DATA(insert OID = 607 (  "="	   PGNSP PGUID b t t	26	26	16 607 608 oideq eqsel eqjoinsel ));
 DESCR("equal");
@@ -669,19 +617,6 @@ DESCR("horizontally aligned");
 DATA(insert OID =  809 (  "?|"	   PGNSP PGUID b f f	600  600	 16  809  0 point_vert - - ));
 DESCR("vertically aligned");
 
-DATA(insert OID = 811 (  "="	   PGNSP PGUID b t f 704 704	16 811 812 tintervaleq eqsel eqjoinsel ));
-DESCR("equal");
-DATA(insert OID = 812 (  "<>"	   PGNSP PGUID b f f 704 704	16 812 811 tintervalne neqsel neqjoinsel ));
-DESCR("not equal");
-DATA(insert OID = 813 (  "<"	   PGNSP PGUID b f f 704 704	16 814 816 tintervallt scalarltsel scalarltjoinsel ));
-DESCR("less than");
-DATA(insert OID = 814 (  ">"	   PGNSP PGUID b f f 704 704	16 813 815 tintervalgt scalargtsel scalargtjoinsel ));
-DESCR("greater than");
-DATA(insert OID = 815 (  "<="	   PGNSP PGUID b f f 704 704	16 816 814 tintervalle scalarlesel scalarlejoinsel ));
-DESCR("less than or equal");
-DATA(insert OID = 816 (  ">="	   PGNSP PGUID b f f 704 704	16 815 813 tintervalge scalargesel scalargejoinsel ));
-DESCR("greater than or equal");
-
 DATA(insert OID = 843 (  "*"	   PGNSP PGUID b f f	790  700	790 845   0 cash_mul_flt4 - - ));
 DESCR("multiply");
 DATA(insert OID = 844 (  "/"	   PGNSP PGUID b f f	790  700	790   0   0 cash_div_flt4 - - ));
diff --git a/src/include/catalog/pg_opfamily.h b/src/include/catalog/pg_opfamily.h
index 0d0ba7c66a2..241388ce649 100644
--- a/src/include/catalog/pg_opfamily.h
+++ b/src/include/catalog/pg_opfamily.h
@@ -58,7 +58,6 @@ typedef FormData_pg_opfamily *Form_pg_opfamily;
  * ----------------
  */
 
-DATA(insert OID =  421 (	403		abstime_ops		PGNSP PGUID ));
 DATA(insert OID =  397 (	403		array_ops		PGNSP PGUID ));
 DATA(insert OID =  627 (	405		array_ops		PGNSP PGUID ));
 DATA(insert OID =  423 (	403		bit_ops			PGNSP PGUID ));
@@ -122,12 +121,8 @@ DATA(insert OID = 2223 (	405		bytea_ops		PGNSP PGUID ));
 DATA(insert OID = 2789 (	403		tid_ops			PGNSP PGUID ));
 DATA(insert OID = 2225 (	405		xid_ops			PGNSP PGUID ));
 DATA(insert OID = 2226 (	405		cid_ops			PGNSP PGUID ));
-DATA(insert OID = 2227 (	405		abstime_ops		PGNSP PGUID ));
-DATA(insert OID = 2228 (	405		reltime_ops		PGNSP PGUID ));
 DATA(insert OID = 2229 (	405		text_pattern_ops	PGNSP PGUID ));
 DATA(insert OID = 2231 (	405		bpchar_pattern_ops	PGNSP PGUID ));
-DATA(insert OID = 2233 (	403		reltime_ops		PGNSP PGUID ));
-DATA(insert OID = 2234 (	403		tinterval_ops	PGNSP PGUID ));
 DATA(insert OID = 2235 (	405		aclitem_ops		PGNSP PGUID ));
 DATA(insert OID = 2593 (	783		box_ops			PGNSP PGUID ));
 DATA(insert OID = 2594 (	783		poly_ops		PGNSP PGUID ));
@@ -170,8 +165,6 @@ DATA(insert OID = 4065 (	3580	name_minmax_ops			PGNSP PGUID ));
 DATA(insert OID = 4068 (	3580	oid_minmax_ops			PGNSP PGUID ));
 DATA(insert OID = 4069 (	3580	tid_minmax_ops			PGNSP PGUID ));
 DATA(insert OID = 4070 (	3580	float_minmax_ops		PGNSP PGUID ));
-DATA(insert OID = 4072 (	3580	abstime_minmax_ops		PGNSP PGUID ));
-DATA(insert OID = 4073 (	3580	reltime_minmax_ops		PGNSP PGUID ));
 DATA(insert OID = 4074 (	3580	macaddr_minmax_ops		PGNSP PGUID ));
 DATA(insert OID = 4109 (	3580	macaddr8_minmax_ops		PGNSP PGUID ));
 DATA(insert OID = 4075 (	3580	network_minmax_ops		PGNSP PGUID ));
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index c9693759811..1774d37b194 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -449,54 +449,6 @@ DATA(insert OID = 238 (  int2			   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 21
 DESCR("convert float4 to int2");
 DATA(insert OID = 239 (  line_distance	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 701 "628 628" _null_ _null_ _null_ _null_ _null_	line_distance _null_ _null_ _null_ ));
 
-DATA(insert OID = 240 (  abstimein		   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 702 "2275" _null_ _null_ _null_ _null_ _null_ abstimein _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 241 (  abstimeout		   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "702" _null_ _null_ _null_ _null_ _null_ abstimeout _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 242 (  reltimein		   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 703 "2275" _null_ _null_ _null_ _null_ _null_ reltimein _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 243 (  reltimeout		   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "703" _null_ _null_ _null_ _null_ _null_ reltimeout _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 244 (  timepl			   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 702 "702 703" _null_ _null_ _null_ _null_ _null_	timepl _null_ _null_ _null_ ));
-DATA(insert OID = 245 (  timemi			   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 702 "702 703" _null_ _null_ _null_ _null_ _null_	timemi _null_ _null_ _null_ ));
-DATA(insert OID = 246 (  tintervalin	   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 704 "2275" _null_ _null_ _null_ _null_ _null_ tintervalin _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 247 (  tintervalout	   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "704" _null_ _null_ _null_ _null_ _null_ tintervalout _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 248 (  intinterval	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "702 704" _null_ _null_ _null_ _null_ _null_ intinterval _null_ _null_ _null_ ));
-DATA(insert OID = 249 (  tintervalrel	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 703 "704" _null_ _null_ _null_ _null_ _null_	tintervalrel _null_ _null_ _null_ ));
-DESCR("tinterval to reltime");
-DATA(insert OID = 250 (  timenow		   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 0 0 702 "" _null_ _null_ _null_ _null_ _null_ timenow _null_ _null_ _null_ ));
-DESCR("current date and time (abstime)");
-DATA(insert OID = 251 (  abstimeeq		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "702 702" _null_ _null_ _null_ _null_ _null_ abstimeeq _null_ _null_ _null_ ));
-DATA(insert OID = 252 (  abstimene		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "702 702" _null_ _null_ _null_ _null_ _null_ abstimene _null_ _null_ _null_ ));
-DATA(insert OID = 253 (  abstimelt		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "702 702" _null_ _null_ _null_ _null_ _null_ abstimelt _null_ _null_ _null_ ));
-DATA(insert OID = 254 (  abstimegt		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "702 702" _null_ _null_ _null_ _null_ _null_ abstimegt _null_ _null_ _null_ ));
-DATA(insert OID = 255 (  abstimele		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "702 702" _null_ _null_ _null_ _null_ _null_ abstimele _null_ _null_ _null_ ));
-DATA(insert OID = 256 (  abstimege		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "702 702" _null_ _null_ _null_ _null_ _null_ abstimege _null_ _null_ _null_ ));
-DATA(insert OID = 257 (  reltimeeq		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "703 703" _null_ _null_ _null_ _null_ _null_ reltimeeq _null_ _null_ _null_ ));
-DATA(insert OID = 258 (  reltimene		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "703 703" _null_ _null_ _null_ _null_ _null_ reltimene _null_ _null_ _null_ ));
-DATA(insert OID = 259 (  reltimelt		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "703 703" _null_ _null_ _null_ _null_ _null_ reltimelt _null_ _null_ _null_ ));
-DATA(insert OID = 260 (  reltimegt		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "703 703" _null_ _null_ _null_ _null_ _null_ reltimegt _null_ _null_ _null_ ));
-DATA(insert OID = 261 (  reltimele		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "703 703" _null_ _null_ _null_ _null_ _null_ reltimele _null_ _null_ _null_ ));
-DATA(insert OID = 262 (  reltimege		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "703 703" _null_ _null_ _null_ _null_ _null_ reltimege _null_ _null_ _null_ ));
-DATA(insert OID = 263 (  tintervalsame	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalsame _null_ _null_ _null_ ));
-DATA(insert OID = 264 (  tintervalct	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalct _null_ _null_ _null_ ));
-DATA(insert OID = 265 (  tintervalov	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalov _null_ _null_ _null_ ));
-DATA(insert OID = 266 (  tintervalleneq    PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervalleneq _null_ _null_ _null_ ));
-DATA(insert OID = 267 (  tintervallenne    PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallenne _null_ _null_ _null_ ));
-DATA(insert OID = 268 (  tintervallenlt    PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallenlt _null_ _null_ _null_ ));
-DATA(insert OID = 269 (  tintervallengt    PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallengt _null_ _null_ _null_ ));
-DATA(insert OID = 270 (  tintervallenle    PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallenle _null_ _null_ _null_ ));
-DATA(insert OID = 271 (  tintervallenge    PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallenge _null_ _null_ _null_ ));
-DATA(insert OID = 272 (  tintervalstart    PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 702 "704" _null_ _null_ _null_ _null_ _null_	tintervalstart _null_ _null_ _null_ ));
-DATA(insert OID = 273 (  tintervalend	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 702 "704" _null_ _null_ _null_ _null_ _null_	tintervalend _null_ _null_ _null_ ));
-DESCR("end of interval");
-DATA(insert OID = 274 (  timeofday		   PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 25 "" _null_ _null_ _null_ _null_ _null_ timeofday _null_ _null_ _null_ ));
-DESCR("current date and time - increments during transactions");
-DATA(insert OID = 275 (  isfinite		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 16 "702" _null_ _null_ _null_ _null_ _null_ abstime_finite _null_ _null_ _null_ ));
-DESCR("finite abstime?");
-
 DATA(insert OID = 277 (  inter_sl		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "601 628" _null_ _null_ _null_ _null_ _null_ inter_sl _null_ _null_ _null_ ));
 DATA(insert OID = 278 (  inter_lb		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "628 603" _null_ _null_ _null_ _null_ _null_ inter_lb _null_ _null_ _null_ ));
 
@@ -627,8 +579,6 @@ DATA(insert OID = 3134 ( btoidsortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i s
 DESCR("sort support");
 DATA(insert OID = 404 (  btoidvectorcmp    PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "30 30" _null_ _null_ _null_ _null_ _null_ btoidvectorcmp _null_ _null_ _null_ ));
 DESCR("less-equal-greater");
-DATA(insert OID = 357 (  btabstimecmp	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "702 702" _null_ _null_ _null_ _null_ _null_ btabstimecmp _null_ _null_ _null_ ));
-DESCR("less-equal-greater");
 DATA(insert OID = 358 (  btcharcmp		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "18 18" _null_ _null_ _null_ _null_ _null_ btcharcmp _null_ _null_ _null_ ));
 DESCR("less-equal-greater");
 DATA(insert OID = 359 (  btnamecmp		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "19 19" _null_ _null_ _null_ _null_ _null_ btnamecmp _null_ _null_ _null_ ));
@@ -641,10 +591,6 @@ DATA(insert OID = 3255 ( bttextsortsupport PGNSP PGUID 12 1 0 0 0 f f f f t f i
 DESCR("sort support");
 DATA(insert OID = 377 (  cash_cmp		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "790 790" _null_ _null_ _null_ _null_ _null_ cash_cmp _null_ _null_ _null_ ));
 DESCR("less-equal-greater");
-DATA(insert OID = 380 (  btreltimecmp	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "703 703" _null_ _null_ _null_ _null_ _null_ btreltimecmp _null_ _null_ _null_ ));
-DESCR("less-equal-greater");
-DATA(insert OID = 381 (  bttintervalcmp    PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "704 704" _null_ _null_ _null_ _null_ _null_ bttintervalcmp _null_ _null_ _null_ ));
-DESCR("less-equal-greater");
 DATA(insert OID = 382 (  btarraycmp		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "2277 2277" _null_ _null_ _null_ _null_ _null_ btarraycmp _null_ _null_ _null_ ));
 DESCR("less-equal-greater");
 
@@ -814,8 +760,6 @@ DESCR("transform a varchar length coercion");
 DATA(insert OID = 669 (  varchar		   PGNSP PGUID 12 1 0 0 varchar_transform f f f f t f i s 3 0 1043 "1043 23 16" _null_ _null_ _null_ _null_ _null_ varchar _null_ _null_ _null_ ));
 DESCR("adjust varchar() to typmod length");
 
-DATA(insert OID = 676 (  mktinterval	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 704 "702 702" _null_ _null_ _null_ _null_ _null_ mktinterval _null_ _null_ _null_ ));
-
 DATA(insert OID = 619 (  oidvectorne	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "30 30" _null_ _null_ _null_ _null_ _null_ oidvectorne _null_ _null_ _null_ ));
 DATA(insert OID = 677 (  oidvectorlt	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "30 30" _null_ _null_ _null_ _null_ _null_ oidvectorlt _null_ _null_ _null_ ));
 DATA(insert OID = 678 (  oidvectorle	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "30 30" _null_ _null_ _null_ _null_ _null_ oidvectorle _null_ _null_ _null_ ));
@@ -970,13 +914,6 @@ DESCR("larger of two");
 DATA(insert OID = 771 (  int2smaller	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 21 "21 21" _null_ _null_ _null_ _null_ _null_ int2smaller _null_ _null_ _null_ ));
 DESCR("smaller of two");
 
-DATA(insert OID = 784 (  tintervaleq	   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervaleq _null_ _null_ _null_ ));
-DATA(insert OID = 785 (  tintervalne	   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalne _null_ _null_ _null_ ));
-DATA(insert OID = 786 (  tintervallt	   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervallt _null_ _null_ _null_ ));
-DATA(insert OID = 787 (  tintervalgt	   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalgt _null_ _null_ _null_ ));
-DATA(insert OID = 788 (  tintervalle	   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalle _null_ _null_ _null_ ));
-DATA(insert OID = 789 (  tintervalge	   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalge _null_ _null_ _null_ ));
-
 /* OIDS 800 - 899 */
 
 DATA(insert OID =  846 (  cash_mul_flt4    PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 700" _null_ _null_ _null_ _null_ _null_	cash_mul_flt4 _null_ _null_ _null_ ));
@@ -1290,8 +1227,6 @@ DATA(insert OID = 1171 (  date_part		   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 2
 DESCR("extract field from timestamp with time zone");
 DATA(insert OID = 1172 (  date_part		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 701 "25 1186" _null_ _null_ _null_ _null_ _null_ interval_part _null_ _null_ _null_ ));
 DESCR("extract field from interval");
-DATA(insert OID = 1173 (  timestamptz	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 1184 "702" _null_ _null_ _null_ _null_ _null_ abstime_timestamptz _null_ _null_ _null_ ));
-DESCR("convert abstime to timestamp with time zone");
 DATA(insert OID = 1174 (  timestamptz	   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 1184 "1082" _null_ _null_ _null_ _null_ _null_ date_timestamptz _null_ _null_ _null_ ));
 DESCR("convert date to timestamp with time zone");
 DATA(insert OID = 2711 (  justify_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 1186 "1186" _null_ _null_ _null_ _null_ _null_ interval_justify_interval _null_ _null_ _null_ ));
@@ -1302,14 +1237,8 @@ DATA(insert OID = 1295 (  justify_days	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s
 DESCR("promote groups of 30 days to numbers of months");
 DATA(insert OID = 1176 (  timestamptz	   PGNSP PGUID 14 1 0 0 0 f f f f t f s s 2 0 1184 "1082 1083" _null_ _null_ _null_ _null_ _null_ "select cast(($1 + $2) as timestamp with time zone)" _null_ _null_ _null_ ));
 DESCR("convert date and time to timestamp with time zone");
-DATA(insert OID = 1177 (  interval		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 1186 "703" _null_ _null_ _null_ _null_ _null_ reltime_interval _null_ _null_ _null_ ));
-DESCR("convert reltime to interval");
 DATA(insert OID = 1178 (  date			   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 1082 "1184" _null_ _null_ _null_ _null_ _null_ timestamptz_date _null_ _null_ _null_ ));
 DESCR("convert timestamp with time zone to date");
-DATA(insert OID = 1179 (  date			   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 1082 "702" _null_ _null_ _null_ _null_ _null_ abstime_date _null_ _null_ _null_ ));
-DESCR("convert abstime to date");
-DATA(insert OID = 1180 (  abstime		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 702 "1184" _null_ _null_ _null_ _null_ _null_ timestamptz_abstime _null_ _null_ _null_ ));
-DESCR("convert timestamp with time zone to abstime");
 DATA(insert OID = 1181 (  age			   PGNSP PGUID 12 1 0 0 0 f f f f t f s r 1 0 23 "28" _null_ _null_ _null_ _null_ _null_ xid_age _null_ _null_ _null_ ));
 DESCR("age of a transaction ID, in transactions before current transaction");
 DATA(insert OID = 3939 (  mxid_age		   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 23 "28" _null_ _null_ _null_ _null_ _null_ mxid_age _null_ _null_ _null_ ));
@@ -1318,8 +1247,6 @@ DESCR("age of a multi-transaction ID, in multi-transactions before current multi
 DATA(insert OID = 1188 (  timestamptz_mi   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1186 "1184 1184" _null_ _null_ _null_ _null_ _null_ timestamp_mi _null_ _null_ _null_ ));
 DATA(insert OID = 1189 (  timestamptz_pl_interval PGNSP PGUID 12 1 0 0 0 f f f f t f s s 2 0 1184 "1184 1186" _null_ _null_ _null_ _null_ _null_ timestamptz_pl_interval _null_ _null_ _null_ ));
 DATA(insert OID = 1190 (  timestamptz_mi_interval PGNSP PGUID 12 1 0 0 0 f f f f t f s s 2 0 1184 "1184 1186" _null_ _null_ _null_ _null_ _null_ timestamptz_mi_interval _null_ _null_ _null_ ));
-DATA(insert OID = 1194 (  reltime			PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 703 "1186" _null_ _null_ _null_ _null_ _null_ interval_reltime _null_ _null_ _null_ ));
-DESCR("convert interval to reltime");
 DATA(insert OID = 1195 (  timestamptz_smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1184 "1184 1184" _null_ _null_ _null_ _null_ _null_ timestamp_smaller _null_ _null_ _null_ ));
 DESCR("smaller of two");
 DATA(insert OID = 1196 (  timestamptz_larger  PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1184 "1184 1184" _null_ _null_ _null_ _null_ _null_ timestamp_larger _null_ _null_ _null_ ));
@@ -1537,9 +1464,6 @@ DESCR("less-equal-greater");
 DATA(insert OID = 1359 (  timestamptz	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1184 "1082 1266" _null_ _null_ _null_ _null_ _null_ datetimetz_timestamptz _null_ _null_ _null_ ));
 DESCR("convert date and time with time zone to timestamp with time zone");
 
-DATA(insert OID = 1364 (  time			   PGNSP PGUID 14 1 0 0 0 f f f f t f s s 1 0 1083 "702" _null_ _null_ _null_ _null_ _null_ "select cast(cast($1 as timestamp without time zone) as pg_catalog.time)" _null_ _null_ _null_ ));
-DESCR("convert abstime to time");
-
 DATA(insert OID = 1367 (  character_length	PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "1042" _null_ _null_ _null_ _null_ _null_ bpcharlen _null_ _null_ _null_ ));
 DESCR("character length");
 DATA(insert OID = 1369 (  character_length	PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "25" _null_ _null_ _null_ _null_ _null_ textlen _null_ _null_ _null_ ));
@@ -1566,10 +1490,6 @@ DESCR("smaller of two");
 DATA(insert OID = 1381 (  char_length	   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 23 "25" _null_ _null_ _null_ _null_ _null_ textlen _null_ _null_ _null_ ));
 DESCR("character length");
 
-DATA(insert OID = 1382 (  date_part    PGNSP PGUID 14 1 0 0 0 f f f f t f s s 2 0 701 "25 702" _null_ _null_ _null_ _null_ _null_ "select pg_catalog.date_part($1, cast($2 as timestamp with time zone))" _null_ _null_ _null_ ));
-DESCR("extract field from abstime");
-DATA(insert OID = 1383 (  date_part    PGNSP PGUID 14 1 0 0 0 f f f f t f s s 2 0 701 "25 703" _null_ _null_ _null_ _null_ _null_ "select pg_catalog.date_part($1, cast($2 as pg_catalog.interval))" _null_ _null_ _null_ ));
-DESCR("extract field from reltime");
 DATA(insert OID = 1384 (  date_part    PGNSP PGUID 14 1 0 0 0 f f f f t f i s 2 0 701 "25 1082" _null_ _null_ _null_ _null_ _null_ "select pg_catalog.date_part($1, cast($2 as timestamp without time zone))" _null_ _null_ _null_ ));
 DESCR("extract field from date");
 DATA(insert OID = 1385 (  date_part    PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 701 "25 1083" _null_ _null_ _null_ _null_  _null_ time_part _null_ _null_ _null_ ));
@@ -1734,8 +1654,6 @@ DATA(insert OID = 1479 (  circle			PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 71
 DESCR("convert box to circle");
 DATA(insert OID = 1480 (  box				PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 603 "718" _null_ _null_ _null_ _null_ _null_ circle_box _null_ _null_ _null_ ));
 DESCR("convert circle to box");
-DATA(insert OID = 1481 (  tinterval			 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 704 "702 702" _null_ _null_ _null_ _null_ _null_ mktinterval _null_ _null_ _null_ ));
-DESCR("convert to tinterval");
 
 DATA(insert OID = 1482 (  lseg_ne			PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "601 601" _null_ _null_ _null_ _null_  _null_ lseg_ne _null_ _null_ _null_ ));
 DATA(insert OID = 1483 (  lseg_lt			PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "601 601" _null_ _null_ _null_ _null_  _null_ lseg_lt _null_ _null_ _null_ ));
@@ -3100,8 +3018,6 @@ DATA(insert OID = 2020 (  date_trunc		PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0
 DESCR("truncate timestamp to specified units");
 DATA(insert OID = 2021 (  date_part			PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 701 "25 1114" _null_ _null_ _null_ _null_ _null_ timestamp_part _null_ _null_ _null_ ));
 DESCR("extract field from timestamp");
-DATA(insert OID = 2023 (  timestamp			PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 1114 "702" _null_ _null_ _null_ _null_ _null_ abstime_timestamp _null_ _null_ _null_ ));
-DESCR("convert abstime to timestamp");
 DATA(insert OID = 2024 (  timestamp			PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 1114 "1082" _null_ _null_ _null_ _null_ _null_ date_timestamp _null_ _null_ _null_ ));
 DESCR("convert date to timestamp");
 DATA(insert OID = 2025 (  timestamp			PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1114 "1082 1083" _null_ _null_ _null_ _null_ _null_	datetime_timestamp _null_ _null_ _null_ ));
@@ -3112,8 +3028,6 @@ DATA(insert OID = 2028 (  timestamptz		PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1
 DESCR("convert timestamp to timestamp with time zone");
 DATA(insert OID = 2029 (  date				PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 1082 "1114" _null_ _null_ _null_ _null_ _null_ timestamp_date _null_ _null_ _null_ ));
 DESCR("convert timestamp to date");
-DATA(insert OID = 2030 (  abstime			PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 702 "1114" _null_ _null_ _null_ _null_ _null_ timestamp_abstime _null_ _null_ _null_ ));
-DESCR("convert timestamp to abstime");
 DATA(insert OID = 2031 (  timestamp_mi		PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1186 "1114 1114" _null_ _null_ _null_ _null_ _null_	timestamp_mi _null_ _null_ _null_ ));
 DATA(insert OID = 2032 (  timestamp_pl_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1114 "1114 1186" _null_ _null_ _null_ _null_ _null_	timestamp_pl_interval _null_ _null_ _null_ ));
 DATA(insert OID = 2033 (  timestamp_mi_interval PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1114 "1114 1186" _null_ _null_ _null_ _null_ _null_	timestamp_mi_interval _null_ _null_ _null_ ));
@@ -3389,8 +3303,6 @@ DATA(insert OID = 2119 (  max				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 700
 DESCR("maximum value of all float4 input values");
 DATA(insert OID = 2120 (  max				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 701 "701" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ ));
 DESCR("maximum value of all float8 input values");
-DATA(insert OID = 2121 (  max				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 702 "702" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ ));
-DESCR("maximum value of all abstime input values");
 DATA(insert OID = 2122 (  max				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 1082 "1082" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ ));
 DESCR("maximum value of all date input values");
 DATA(insert OID = 2123 (  max				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 1083 "1083" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ ));
@@ -3430,8 +3342,6 @@ DATA(insert OID = 2135 (  min				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 700
 DESCR("minimum value of all float4 input values");
 DATA(insert OID = 2136 (  min				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 701 "701" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ ));
 DESCR("minimum value of all float8 input values");
-DATA(insert OID = 2137 (  min				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 702 "702" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ ));
-DESCR("minimum value of all abstime input values");
 DATA(insert OID = 2138 (  min				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 1082 "1082" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ ));
 DESCR("minimum value of all date input values");
 DATA(insert OID = 2139 (  min				PGNSP PGUID 12 1 0 0 0 t f f f f f i s 1 0 1083 "1083" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ ));
@@ -4085,18 +3995,6 @@ DATA(insert OID = 2460 (  numeric_recv		   PGNSP PGUID 12 1 0 0 0 f f f f t f i
 DESCR("I/O");
 DATA(insert OID = 2461 (  numeric_send		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "1700" _null_ _null_ _null_ _null_ _null_	numeric_send _null_ _null_ _null_ ));
 DESCR("I/O");
-DATA(insert OID = 2462 (  abstimerecv		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 702 "2281" _null_ _null_ _null_ _null_ _null_ abstimerecv _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 2463 (  abstimesend		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "702" _null_ _null_ _null_ _null_ _null_ abstimesend _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 2464 (  reltimerecv		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 703 "2281" _null_ _null_ _null_ _null_ _null_ reltimerecv _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 2465 (  reltimesend		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "703" _null_ _null_ _null_ _null_ _null_ reltimesend _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 2466 (  tintervalrecv		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 704 "2281" _null_ _null_ _null_ _null_ _null_ tintervalrecv _null_ _null_ _null_ ));
-DESCR("I/O");
-DATA(insert OID = 2467 (  tintervalsend		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "704" _null_ _null_ _null_ _null_ _null_ tintervalsend _null_ _null_ _null_ ));
-DESCR("I/O");
 DATA(insert OID = 2468 (  date_recv			   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 1082 "2281" _null_ _null_ _null_ _null_ _null_ date_recv _null_ _null_ _null_ ));
 DESCR("I/O");
 DATA(insert OID = 2469 (  date_send			   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "1082" _null_ _null_ _null_ _null_ _null_	date_send _null_ _null_ _null_ ));
diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h
index e3551440a04..fe3d597dfa3 100644
--- a/src/include/catalog/pg_type.h
+++ b/src/include/catalog/pg_type.h
@@ -417,14 +417,6 @@ DESCR("single-precision floating point number, 4-byte storage");
 DATA(insert OID = 701 (  float8    PGNSP PGUID	8 FLOAT8PASSBYVAL b N t t \054 0	 0 1022 float8in float8out float8recv float8send - - - d p f 0 -1 0 0 _null_ _null_ _null_ ));
 DESCR("double-precision floating point number, 8-byte storage");
 #define FLOAT8OID 701
-DATA(insert OID = 702 (  abstime   PGNSP PGUID	4 t b D f t \054 0	 0 1023 abstimein abstimeout abstimerecv abstimesend - - - i p f 0 -1 0 0 _null_ _null_ _null_ ));
-DESCR("absolute, limited-range date and time (Unix system time)");
-#define ABSTIMEOID		702
-DATA(insert OID = 703 (  reltime   PGNSP PGUID	4 t b T f t \054 0	 0 1024 reltimein reltimeout reltimerecv reltimesend - - - i p f 0 -1 0 0 _null_ _null_ _null_ ));
-DESCR("relative, limited-range time interval (Unix delta time)");
-#define RELTIMEOID		703
-DATA(insert OID = 704 (  tinterval PGNSP PGUID 12 f b T f t \054 0	 0 1025 tintervalin tintervalout tintervalrecv tintervalsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ ));
-DESCR("(abstime,abstime), time interval");
 #define TINTERVALOID	704
 DATA(insert OID = 705 (  unknown   PGNSP PGUID -2 f p X f t \054 0	 0 0 unknownin unknownout unknownrecv unknownsend - - - c p f 0 -1 0 0 _null_ _null_ _null_ ));
 DESCR("");
@@ -484,9 +476,6 @@ DATA(insert OID = 1020 (  _box		 PGNSP PGUID -1 f b A f t \073 0 603 0 array_in
 DATA(insert OID = 1021 (  _float4	 PGNSP PGUID -1 f b A f t \054 0 700 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
 #define FLOAT4ARRAYOID 1021
 DATA(insert OID = 1022 (  _float8	 PGNSP PGUID -1 f b A f t \054 0 701 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ ));
-DATA(insert OID = 1023 (  _abstime	 PGNSP PGUID -1 f b A f t \054 0 702 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
-DATA(insert OID = 1024 (  _reltime	 PGNSP PGUID -1 f b A f t \054 0 703 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
-DATA(insert OID = 1025 (  _tinterval PGNSP PGUID -1 f b A f t \054 0 704 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ ));
 DATA(insert OID = 1027 (  _polygon	 PGNSP PGUID -1 f b A f t \054 0 604 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ ));
 DATA(insert OID = 1033 (  aclitem	 PGNSP PGUID 12 f b U f t \054 0 0 1034 aclitemin aclitemout - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ ));
 DESCR("access control list");
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h
index 7968569fdad..f0045aa7bf2 100644
--- a/src/include/utils/datetime.h
+++ b/src/include/utils/datetime.h
@@ -3,7 +3,7 @@
  * datetime.h
  *	  Definitions for date/time support code.
  *	  The support code is shared with other date data types,
- *	   including abstime, reltime, date, and time.
+ *	   including date, and time.
  *
  *
  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
diff --git a/src/include/utils/nabstime.h b/src/include/utils/nabstime.h
deleted file mode 100644
index 69133952d18..00000000000
--- a/src/include/utils/nabstime.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * nabstime.h
- *	  Definitions for the "new" abstime code.
- *
- *
- * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * src/include/utils/nabstime.h
- *
- *-------------------------------------------------------------------------
- */
-#ifndef NABSTIME_H
-#define NABSTIME_H
-
-#include <limits.h>
-
-#include "fmgr.h"
-#include "pgtime.h"
-
-
-/* ----------------------------------------------------------------
- *
- *				time types + support macros
- *
- * ----------------------------------------------------------------
- */
-
-/*
- * Although time_t generally is a long int on 64 bit systems, these two
- * types must be 4 bytes, because that's what pg_type.h assumes. They
- * should be yanked (long) before 2038 and be replaced by timestamp and
- * interval.
- */
-typedef int32 AbsoluteTime;
-typedef int32 RelativeTime;
-
-typedef struct
-{
-	int32		status;
-	AbsoluteTime data[2];
-} TimeIntervalData;
-
-typedef TimeIntervalData *TimeInterval;
-
-/*
- * Macros for fmgr-callable functions.
- */
-#define DatumGetAbsoluteTime(X)  ((AbsoluteTime) DatumGetInt32(X))
-#define DatumGetRelativeTime(X)  ((RelativeTime) DatumGetInt32(X))
-#define DatumGetTimeInterval(X)  ((TimeInterval) DatumGetPointer(X))
-
-#define AbsoluteTimeGetDatum(X)  Int32GetDatum(X)
-#define RelativeTimeGetDatum(X)  Int32GetDatum(X)
-#define TimeIntervalGetDatum(X)  PointerGetDatum(X)
-
-#define PG_GETARG_ABSOLUTETIME(n)  DatumGetAbsoluteTime(PG_GETARG_DATUM(n))
-#define PG_GETARG_RELATIVETIME(n)  DatumGetRelativeTime(PG_GETARG_DATUM(n))
-#define PG_GETARG_TIMEINTERVAL(n)  DatumGetTimeInterval(PG_GETARG_DATUM(n))
-
-#define PG_RETURN_ABSOLUTETIME(x)  return AbsoluteTimeGetDatum(x)
-#define PG_RETURN_RELATIVETIME(x)  return RelativeTimeGetDatum(x)
-#define PG_RETURN_TIMEINTERVAL(x)  return TimeIntervalGetDatum(x)
-
-/*
- * Reserved values
- * Epoch is Unix system time zero, but needs to be kept as a reserved
- *	value rather than converting to time since timezone calculations
- *	might move it away from 1970-01-01 00:00:00Z - tgl 97/02/20
- *
- * Pre-v6.1 code had large decimal numbers for reserved values.
- * These were chosen as special 32-bit bit patterns,
- *	so redefine them explicitly using these bit patterns. - tgl 97/02/24
- */
-#define INVALID_ABSTIME ((AbsoluteTime) 0x7FFFFFFE) /* 2147483647 (2^31 - 1) */
-#define NOEND_ABSTIME	((AbsoluteTime) 0x7FFFFFFC) /* 2147483645 (2^31 - 3) */
-#define NOSTART_ABSTIME ((AbsoluteTime) INT_MIN)	/* -2147483648 */
-
-#define INVALID_RELTIME ((RelativeTime) 0x7FFFFFFE) /* 2147483647 (2^31 - 1) */
-
-#define AbsoluteTimeIsValid(time) \
-	((bool) ((time) != INVALID_ABSTIME))
-
-/*
- * Because NOSTART_ABSTIME is defined as INT_MIN, there can't be any
- * AbsoluteTime values less than it.  Therefore, we can code the test
- * "time > NOSTART_ABSTIME" as "time != NOSTART_ABSTIME", which avoids
- * compiler bugs on some platforms.  --- tgl & az, 11/2000
- */
-#define AbsoluteTimeIsReal(time) \
-	((bool) (((AbsoluteTime) (time)) < NOEND_ABSTIME && \
-			  ((AbsoluteTime) (time)) != NOSTART_ABSTIME))
-
-#define RelativeTimeIsValid(time) \
-	((bool) (((RelativeTime) (time)) != INVALID_RELTIME))
-
-
-/* non-fmgr-callable support routines */
-extern AbsoluteTime GetCurrentAbsoluteTime(void);
-extern void abstime2tm(AbsoluteTime time, int *tzp, struct pg_tm *tm, char **tzn);
-
-#endif							/* NABSTIME_H */
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 7d6d7d0754c..e355e6b4cfe 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -223,12 +223,6 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia
 			return ECPG_ARRAY_ERROR;
 		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), FLOAT8OID, ECPG_ARRAY_NONE, stmt->lineno))
 			return ECPG_ARRAY_ERROR;
-		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), ABSTIMEOID, ECPG_ARRAY_NONE, stmt->lineno))
-			return ECPG_ARRAY_ERROR;
-		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), RELTIMEOID, ECPG_ARRAY_NONE, stmt->lineno))
-			return ECPG_ARRAY_ERROR;
-		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TINTERVALOID, ECPG_ARRAY_NONE, stmt->lineno))
-			return ECPG_ARRAY_ERROR;
 		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), UNKNOWNOID, ECPG_ARRAY_NONE, stmt->lineno))
 			return ECPG_ARRAY_ERROR;
 		if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), CIRCLEOID, ECPG_ARRAY_NONE, stmt->lineno))
diff --git a/src/interfaces/ecpg/ecpglib/pg_type.h b/src/interfaces/ecpg/ecpglib/pg_type.h
index 94d2d9287b4..475593e6764 100644
--- a/src/interfaces/ecpg/ecpglib/pg_type.h
+++ b/src/interfaces/ecpg/ecpglib/pg_type.h
@@ -38,9 +38,6 @@
 #define LINEOID			628
 #define FLOAT4OID 700
 #define FLOAT8OID 701
-#define ABSTIMEOID		702
-#define RELTIMEOID		703
-#define TINTERVALOID	704
 #define UNKNOWNOID		705
 #define CIRCLEOID		718
 #define CASHOID 790
diff --git a/src/interfaces/ecpg/test/expected/thread-thread.c b/src/interfaces/ecpg/test/expected/thread-thread.c
index 420bbf194a8..7fb74858c71 100644
--- a/src/interfaces/ecpg/test/expected/thread-thread.c
+++ b/src/interfaces/ecpg/test/expected/thread-thread.c
@@ -76,7 +76,7 @@ int main()
   { ECPGtrans(__LINE__, NULL, "commit");}
 #line 49 "thread.pgc"
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test_thread ( tstamp timestamp not null default cast ( timeofday ( ) as timestamp ) , thread text not null , iteration integer not null , primary key ( thread , iteration ) )", ECPGt_EOIT, ECPGt_EORT);}
+  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test_thread ( tstamp timestamp not null default cast ( clock_timestamp ( ) as timestamp ) , thread text not null , iteration integer not null , primary key ( thread , iteration ) )", ECPGt_EOIT, ECPGt_EORT);}
 #line 54 "thread.pgc"
 
   { ECPGtrans(__LINE__, NULL, "commit");}
diff --git a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c
index 4bddca9fb98..6a2c73530ee 100644
--- a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c
+++ b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c
@@ -77,7 +77,7 @@ int main()
   { ECPGtrans(__LINE__, NULL, "commit");}
 #line 50 "thread_implicit.pgc"
 
-  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test_thread ( tstamp timestamp not null default cast ( timeofday ( ) as timestamp ) , thread text not null , iteration integer not null , primary key ( thread , iteration ) )", ECPGt_EOIT, ECPGt_EORT);}
+  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test_thread ( tstamp timestamp not null default cast ( clock_timestamp ( ) as timestamp ) , thread text not null , iteration integer not null , primary key ( thread , iteration ) )", ECPGt_EOIT, ECPGt_EORT);}
 #line 55 "thread_implicit.pgc"
 
   { ECPGtrans(__LINE__, NULL, "commit");}
diff --git a/src/interfaces/ecpg/test/thread/thread.pgc b/src/interfaces/ecpg/test/thread/thread.pgc
index ae6b229962b..75ca1cdcbf5 100644
--- a/src/interfaces/ecpg/test/thread/thread.pgc
+++ b/src/interfaces/ecpg/test/thread/thread.pgc
@@ -48,7 +48,7 @@ int main()
   EXEC SQL DROP TABLE test_thread; /* DROP might fail */
   EXEC SQL COMMIT;
   EXEC SQL CREATE TABLE
-    test_thread(tstamp    TIMESTAMP NOT NULL DEFAULT CAST(timeofday() AS TIMESTAMP),
+    test_thread(tstamp    TIMESTAMP NOT NULL DEFAULT CAST(clock_timestamp() AS TIMESTAMP),
 		thread    TEXT      NOT NULL,
 		iteration INTEGER   NOT NULL,
 		PRIMARY KEY(thread, iteration));
diff --git a/src/interfaces/ecpg/test/thread/thread_implicit.pgc b/src/interfaces/ecpg/test/thread/thread_implicit.pgc
index 0dfcb7172bc..2e96bcbeb47 100644
--- a/src/interfaces/ecpg/test/thread/thread_implicit.pgc
+++ b/src/interfaces/ecpg/test/thread/thread_implicit.pgc
@@ -49,7 +49,7 @@ int main()
   EXEC SQL DROP TABLE test_thread; /* DROP might fail */
   EXEC SQL COMMIT;
   EXEC SQL CREATE TABLE
-    test_thread(tstamp    TIMESTAMP NOT NULL DEFAULT CAST(timeofday() AS TIMESTAMP),
+    test_thread(tstamp    TIMESTAMP NOT NULL DEFAULT CAST(clock_timestamp() AS TIMESTAMP),
 		thread    TEXT      NOT NULL,
 		iteration INTEGER   NOT NULL,
 		PRIMARY KEY(thread, iteration));
diff --git a/src/test/regress/expected/abstime.out b/src/test/regress/expected/abstime.out
deleted file mode 100644
index ed48f642ab3..00000000000
--- a/src/test/regress/expected/abstime.out
+++ /dev/null
@@ -1,136 +0,0 @@
---
--- ABSTIME
--- testing built-in time type abstime
--- uses reltime and tinterval
---
---
--- timezones may vary based not only on location but the operating
--- system.  the main correctness issue is that the OS may not get
--- daylight savings time right for times prior to Unix epoch (jan 1 1970).
---
-CREATE TABLE ABSTIME_TBL (f1 abstime);
-BEGIN;
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'now');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'now');
-SELECT count(*) AS two FROM ABSTIME_TBL WHERE f1 = 'now' ;
- two 
------
-   2
-(1 row)
-
-END;
-DELETE FROM ABSTIME_TBL;
-INSERT INTO ABSTIME_TBL (f1) VALUES ('Jan 14, 1973 03:14:21');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'Mon May  1 00:30:30 1995');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'epoch');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'infinity');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime '-infinity');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'May 10, 1947 23:59:12');
--- what happens if we specify slightly misformatted abstime?
-INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 35, 1946 10:00:00');
-ERROR:  date/time field value out of range: "Feb 35, 1946 10:00:00"
-LINE 1: INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 35, 1946 10:00:00'...
-                                             ^
-HINT:  Perhaps you need a different "datestyle" setting.
-INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 28, 1984 25:08:10');
-ERROR:  date/time field value out of range: "Feb 28, 1984 25:08:10"
-LINE 1: INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 28, 1984 25:08:10'...
-                                             ^
--- badly formatted abstimes:  these should result in invalid abstimes
-INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format');
-ERROR:  invalid input syntax for type abstime: "bad date format"
-LINE 1: INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format');
-                                             ^
-INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843');
--- test abstime operators
-SELECT '' AS eight, * FROM ABSTIME_TBL;
- eight |              f1              
--------+------------------------------
-       | Sun Jan 14 03:14:21 1973 PST
-       | Mon May 01 00:30:30 1995 PDT
-       | Wed Dec 31 16:00:00 1969 PST
-       | infinity
-       | -infinity
-       | Sat May 10 23:59:12 1947 PST
-       | invalid
-(7 rows)
-
-SELECT '' AS six, * FROM ABSTIME_TBL
-   WHERE ABSTIME_TBL.f1 < abstime 'Jun 30, 2001';
- six |              f1              
------+------------------------------
-     | Sun Jan 14 03:14:21 1973 PST
-     | Mon May 01 00:30:30 1995 PDT
-     | Wed Dec 31 16:00:00 1969 PST
-     | -infinity
-     | Sat May 10 23:59:12 1947 PST
-(5 rows)
-
-SELECT '' AS six, * FROM ABSTIME_TBL
-   WHERE ABSTIME_TBL.f1 > abstime '-infinity';
- six |              f1              
------+------------------------------
-     | Sun Jan 14 03:14:21 1973 PST
-     | Mon May 01 00:30:30 1995 PDT
-     | Wed Dec 31 16:00:00 1969 PST
-     | infinity
-     | Sat May 10 23:59:12 1947 PST
-     | invalid
-(6 rows)
-
-SELECT '' AS six, * FROM ABSTIME_TBL
-   WHERE abstime 'May 10, 1947 23:59:12' <> ABSTIME_TBL.f1;
- six |              f1              
------+------------------------------
-     | Sun Jan 14 03:14:21 1973 PST
-     | Mon May 01 00:30:30 1995 PDT
-     | Wed Dec 31 16:00:00 1969 PST
-     | infinity
-     | -infinity
-     | invalid
-(6 rows)
-
-SELECT '' AS three, * FROM ABSTIME_TBL
-   WHERE abstime 'epoch' >= ABSTIME_TBL.f1;
- three |              f1              
--------+------------------------------
-       | Wed Dec 31 16:00:00 1969 PST
-       | -infinity
-       | Sat May 10 23:59:12 1947 PST
-(3 rows)
-
-SELECT '' AS four, * FROM ABSTIME_TBL
-   WHERE ABSTIME_TBL.f1 <= abstime 'Jan 14, 1973 03:14:21';
- four |              f1              
-------+------------------------------
-      | Sun Jan 14 03:14:21 1973 PST
-      | Wed Dec 31 16:00:00 1969 PST
-      | -infinity
-      | Sat May 10 23:59:12 1947 PST
-(4 rows)
-
-SELECT '' AS four, * FROM ABSTIME_TBL
-  WHERE ABSTIME_TBL.f1 <?>
-	tinterval '["Apr 1 1950 00:00:00" "Dec 30 1999 23:00:00"]';
- four |              f1              
-------+------------------------------
-      | Sun Jan 14 03:14:21 1973 PST
-      | Mon May 01 00:30:30 1995 PDT
-      | Wed Dec 31 16:00:00 1969 PST
-(3 rows)
-
-SELECT '' AS four, f1 AS abstime,
-  date_part('year', f1) AS year, date_part('month', f1) AS month,
-  date_part('day',f1) AS day, date_part('hour', f1) AS hour,
-  date_part('minute', f1) AS minute, date_part('second', f1) AS second
-  FROM ABSTIME_TBL
-  WHERE isfinite(f1)
-  ORDER BY abstime;
- four |           abstime            | year | month | day | hour | minute | second 
-------+------------------------------+------+-------+-----+------+--------+--------
-      | Sat May 10 23:59:12 1947 PST | 1947 |     5 |  10 |   23 |     59 |     12
-      | Wed Dec 31 16:00:00 1969 PST | 1969 |    12 |  31 |   16 |      0 |      0
-      | Sun Jan 14 03:14:21 1973 PST | 1973 |     1 |  14 |    3 |     14 |     21
-      | Mon May 01 00:30:30 1995 PDT | 1995 |     5 |   1 |    0 |     30 |     30
-(4 rows)
-
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index 11f0baa11b0..0449402aa3d 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -16,9 +16,7 @@ ALTER TABLE tmp ADD COLUMN d float8;
 ALTER TABLE tmp ADD COLUMN e float4;
 ALTER TABLE tmp ADD COLUMN f int2;
 ALTER TABLE tmp ADD COLUMN g polygon;
-ALTER TABLE tmp ADD COLUMN h abstime;
 ALTER TABLE tmp ADD COLUMN i char;
-ALTER TABLE tmp ADD COLUMN j abstime[];
 ALTER TABLE tmp ADD COLUMN k int4;
 ALTER TABLE tmp ADD COLUMN l tid;
 ALTER TABLE tmp ADD COLUMN m xid;
@@ -29,24 +27,23 @@ ALTER TABLE tmp ADD COLUMN q point;
 ALTER TABLE tmp ADD COLUMN r lseg;
 ALTER TABLE tmp ADD COLUMN s path;
 ALTER TABLE tmp ADD COLUMN t box;
-ALTER TABLE tmp ADD COLUMN u tinterval;
 ALTER TABLE tmp ADD COLUMN v timestamp;
 ALTER TABLE tmp ADD COLUMN w interval;
 ALTER TABLE tmp ADD COLUMN x float8[];
 ALTER TABLE tmp ADD COLUMN y float4[];
 ALTER TABLE tmp ADD COLUMN z int2[];
-INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
+INSERT INTO tmp (a, b, c, d, e, f, g,    i,    k, l, m, n, p, q, r, s, t,
 	v, w, x, y, z)
    VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
-        'Mon May  1 00:30:30 1995', 'c', '{Mon May  1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
+	'c',
 	314159, '(1,1)', '512',
 	'1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
-	'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["epoch" "infinity"]',
+	'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
 	'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
 SELECT * FROM tmp;
- initial | a |  b   |  c   |  d  |  e  | f |           g           |              h               | i |                                               j                                                |   k    |   l   |  m  |        n        |       p       |     q     |           r           |              s              |          t          |                      u                      |            v             |        w         |     x     |     y     |     z     
----------+---+------+------+-----+-----+---+-----------------------+------------------------------+---+------------------------------------------------------------------------------------------------+--------+-------+-----+-----------------+---------------+-----------+-----------------------+-----------------------------+---------------------+---------------------------------------------+--------------------------+------------------+-----------+-----------+-----------
-         | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | Mon May 01 00:30:30 1995 PDT | c | {"Mon May 01 00:30:30 1995 PDT","Mon Aug 24 14:43:07 1992 PDT","Wed Dec 31 16:00:00 1969 PST"} | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | magnetic disk | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | ["Wed Dec 31 16:00:00 1969 PST" "infinity"] | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4}
+ initial | a |  b   |  c   |  d  |  e  | f |           g           | i |   k    |   l   |  m  |        n        |       p       |     q     |           r           |              s              |          t          |            v             |        w         |     x     |     y     |     z     
+---------+---+------+------+-----+-----+---+-----------------------+---+--------+-------+-----+-----------------+---------------+-----------+-----------------------+-----------------------------+---------------------+--------------------------+------------------+-----------+-----------+-----------
+         | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | c | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | magnetic disk | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4}
 (1 row)
 
 DROP TABLE tmp;
@@ -61,9 +58,7 @@ ALTER TABLE tmp ADD COLUMN d float8;
 ALTER TABLE tmp ADD COLUMN e float4;
 ALTER TABLE tmp ADD COLUMN f int2;
 ALTER TABLE tmp ADD COLUMN g polygon;
-ALTER TABLE tmp ADD COLUMN h abstime;
 ALTER TABLE tmp ADD COLUMN i char;
-ALTER TABLE tmp ADD COLUMN j abstime[];
 ALTER TABLE tmp ADD COLUMN k int4;
 ALTER TABLE tmp ADD COLUMN l tid;
 ALTER TABLE tmp ADD COLUMN m xid;
@@ -74,24 +69,23 @@ ALTER TABLE tmp ADD COLUMN q point;
 ALTER TABLE tmp ADD COLUMN r lseg;
 ALTER TABLE tmp ADD COLUMN s path;
 ALTER TABLE tmp ADD COLUMN t box;
-ALTER TABLE tmp ADD COLUMN u tinterval;
 ALTER TABLE tmp ADD COLUMN v timestamp;
 ALTER TABLE tmp ADD COLUMN w interval;
 ALTER TABLE tmp ADD COLUMN x float8[];
 ALTER TABLE tmp ADD COLUMN y float4[];
 ALTER TABLE tmp ADD COLUMN z int2[];
-INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
+INSERT INTO tmp (a, b, c, d, e, f, g,    i,   k, l, m, n, p, q, r, s, t,
 	v, w, x, y, z)
    VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
-        'Mon May  1 00:30:30 1995', 'c', '{Mon May  1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
+        'c',
 	314159, '(1,1)', '512',
 	'1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
-	'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["epoch" "infinity"]',
+	'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
 	'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
 SELECT * FROM tmp;
- initial | a |  b   |  c   |  d  |  e  | f |           g           |              h               | i |                                               j                                                |   k    |   l   |  m  |        n        |       p       |     q     |           r           |              s              |          t          |                      u                      |            v             |        w         |     x     |     y     |     z     
----------+---+------+------+-----+-----+---+-----------------------+------------------------------+---+------------------------------------------------------------------------------------------------+--------+-------+-----+-----------------+---------------+-----------+-----------------------+-----------------------------+---------------------+---------------------------------------------+--------------------------+------------------+-----------+-----------+-----------
-         | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | Mon May 01 00:30:30 1995 PDT | c | {"Mon May 01 00:30:30 1995 PDT","Mon Aug 24 14:43:07 1992 PDT","Wed Dec 31 16:00:00 1969 PST"} | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | magnetic disk | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | ["Wed Dec 31 16:00:00 1969 PST" "infinity"] | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4}
+ initial | a |  b   |  c   |  d  |  e  | f |           g           | i |   k    |   l   |  m  |        n        |       p       |     q     |           r           |              s              |          t          |            v             |        w         |     x     |     y     |     z     
+---------+---+------+------+-----+-----+---+-----------------------+---+--------+-------+-----+-----------------+---------------+-----------+-----------------------+-----------------------------+---------------------+--------------------------+------------------+-----------+-----------+-----------
+         | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | c | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | magnetic disk | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4}
 (1 row)
 
 CREATE INDEX tmp_idx ON tmp (a, (d + e), b);
diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out
index 7b3d058425d..f54798ee93f 100644
--- a/src/test/regress/expected/horology.out
+++ b/src/test/regress/expected/horology.out
@@ -2046,70 +2046,6 @@ SELECT '' AS "226", d1.f1 AS timestamp1, d2.f1 AS timestamp2, d1.f1 - d2.f1 AS d
      | Sat Sep 22 18:19:20 2001 PDT | Sat Sep 22 18:19:20 2001 PDT | @ 0
 (256 rows)
 
---
--- abstime, reltime arithmetic
---
-SELECT '' AS ten, ABSTIME_TBL.f1 AS abstime, RELTIME_TBL.f1 AS reltime
-    FROM ABSTIME_TBL, RELTIME_TBL
-   WHERE (ABSTIME_TBL.f1 + RELTIME_TBL.f1) < abstime 'Jan 14 14:00:00 1971'
-   ORDER BY abstime, reltime;
- ten |           abstime            |    reltime    
------+------------------------------+---------------
-     | Sat May 10 23:59:12 1947 PST | @ 14 secs ago
-     | Sat May 10 23:59:12 1947 PST | @ 1 min
-     | Sat May 10 23:59:12 1947 PST | @ 5 hours
-     | Sat May 10 23:59:12 1947 PST | @ 10 days
-     | Sat May 10 23:59:12 1947 PST | @ 3 mons
-     | Wed Dec 31 16:00:00 1969 PST | @ 14 secs ago
-     | Wed Dec 31 16:00:00 1969 PST | @ 1 min
-     | Wed Dec 31 16:00:00 1969 PST | @ 5 hours
-     | Wed Dec 31 16:00:00 1969 PST | @ 10 days
-     | Wed Dec 31 16:00:00 1969 PST | @ 3 mons
-(10 rows)
-
--- these four queries should return the same answer
--- the "infinity" and "-infinity" tuples in ABSTIME_TBL cannot be added and
--- therefore, should not show up in the results.
-SELECT '' AS three, * FROM ABSTIME_TBL
-  WHERE  (ABSTIME_TBL.f1 + reltime '@ 3 year')         -- +3 years
-    < abstime 'Jan 14 14:00:00 1977';
- three |              f1              
--------+------------------------------
-       | Sun Jan 14 03:14:21 1973 PST
-       | Wed Dec 31 16:00:00 1969 PST
-       | Sat May 10 23:59:12 1947 PST
-(3 rows)
-
-SELECT '' AS three, * FROM ABSTIME_TBL
-   WHERE  (ABSTIME_TBL.f1 + reltime '@ 3 year ago')    -- -3 years
-     < abstime 'Jan 14 14:00:00 1971';
- three |              f1              
--------+------------------------------
-       | Sun Jan 14 03:14:21 1973 PST
-       | Wed Dec 31 16:00:00 1969 PST
-       | Sat May 10 23:59:12 1947 PST
-(3 rows)
-
-SELECT '' AS three, * FROM ABSTIME_TBL
-   WHERE  (ABSTIME_TBL.f1 - reltime '@ 3 year')        -- -(+3) years
-    < abstime 'Jan 14 14:00:00 1971';
- three |              f1              
--------+------------------------------
-       | Sun Jan 14 03:14:21 1973 PST
-       | Wed Dec 31 16:00:00 1969 PST
-       | Sat May 10 23:59:12 1947 PST
-(3 rows)
-
-SELECT '' AS three, * FROM ABSTIME_TBL
-   WHERE  (ABSTIME_TBL.f1 - reltime '@ 3 year ago')    -- -(-3) years
-     < abstime 'Jan 14 14:00:00 1977';
- three |              f1              
--------+------------------------------
-       | Sun Jan 14 03:14:21 1973 PST
-       | Wed Dec 31 16:00:00 1969 PST
-       | Sat May 10 23:59:12 1947 PST
-(3 rows)
-
 --
 -- Conversions
 --
@@ -2137,80 +2073,6 @@ SELECT '' AS "16", f1 AS "timestamp", date(f1) AS date
     | Sat Sep 22 18:19:20 2001 PDT | 09-22-2001
 (16 rows)
 
-SELECT '' AS "16", f1 AS "timestamp", abstime(f1) AS abstime
-  FROM TEMP_TIMESTAMP
-  ORDER BY abstime;
- 16 |          timestamp           |           abstime            
-----+------------------------------+------------------------------
-    | Thu Jan 01 00:00:00 1970 PST | Thu Jan 01 00:00:00 1970 PST
-    | Wed Feb 28 17:32:01 1996 PST | Wed Feb 28 17:32:01 1996 PST
-    | Thu Feb 29 17:32:01 1996 PST | Thu Feb 29 17:32:01 1996 PST
-    | Fri Mar 01 17:32:01 1996 PST | Fri Mar 01 17:32:01 1996 PST
-    | Mon Dec 30 17:32:01 1996 PST | Mon Dec 30 17:32:01 1996 PST
-    | Tue Dec 31 17:32:01 1996 PST | Tue Dec 31 17:32:01 1996 PST
-    | Fri Dec 31 17:32:01 1999 PST | Fri Dec 31 17:32:01 1999 PST
-    | Sat Jan 01 17:32:01 2000 PST | Sat Jan 01 17:32:01 2000 PST
-    | Wed Mar 15 02:14:05 2000 PST | Wed Mar 15 02:14:05 2000 PST
-    | Wed Mar 15 03:14:04 2000 PST | Wed Mar 15 03:14:04 2000 PST
-    | Wed Mar 15 08:14:01 2000 PST | Wed Mar 15 08:14:01 2000 PST
-    | Wed Mar 15 12:14:03 2000 PST | Wed Mar 15 12:14:03 2000 PST
-    | Wed Mar 15 13:14:02 2000 PST | Wed Mar 15 13:14:02 2000 PST
-    | Sun Dec 31 17:32:01 2000 PST | Sun Dec 31 17:32:01 2000 PST
-    | Mon Jan 01 17:32:01 2001 PST | Mon Jan 01 17:32:01 2001 PST
-    | Sat Sep 22 18:19:20 2001 PDT | Sat Sep 22 18:19:20 2001 PDT
-(16 rows)
-
-SELECT '' AS four, f1 AS abstime, date(f1) AS date
-  FROM ABSTIME_TBL
-  WHERE isfinite(f1) AND f1 <> abstime 'now'
-  ORDER BY date, abstime;
- four |           abstime            |    date    
-------+------------------------------+------------
-      | Sat May 10 23:59:12 1947 PST | 05-10-1947
-      | Wed Dec 31 16:00:00 1969 PST | 12-31-1969
-      | Sun Jan 14 03:14:21 1973 PST | 01-14-1973
-      | Mon May 01 00:30:30 1995 PDT | 05-01-1995
-(4 rows)
-
-SELECT '' AS two, d1 AS "timestamp", abstime(d1) AS abstime
-  FROM TIMESTAMP_TBL WHERE NOT isfinite(d1);
- two | timestamp |  abstime  
------+-----------+-----------
-     | -infinity | -infinity
-     | infinity  | infinity
-(2 rows)
-
-SELECT '' AS three, f1 as abstime, cast(f1 as timestamp) AS "timestamp"
-  FROM ABSTIME_TBL WHERE NOT isfinite(f1);
-ERROR:  cannot convert abstime "invalid" to timestamp
-SELECT '' AS ten, f1 AS interval, reltime(f1) AS reltime
-  FROM INTERVAL_TBL;
- ten |           interval            |            reltime            
------+-------------------------------+-------------------------------
-     | @ 1 min                       | @ 1 min
-     | @ 5 hours                     | @ 5 hours
-     | @ 10 days                     | @ 10 days
-     | @ 34 years                    | @ 34 years
-     | @ 3 mons                      | @ 3 mons
-     | @ 14 secs ago                 | @ 14 secs ago
-     | @ 1 day 2 hours 3 mins 4 secs | @ 1 day 2 hours 3 mins 4 secs
-     | @ 6 years                     | @ 6 years
-     | @ 5 mons                      | @ 5 mons
-     | @ 5 mons 12 hours             | @ 5 mons 12 hours
-(10 rows)
-
-SELECT '' AS six, f1 as reltime, CAST(f1 AS interval) AS interval
-  FROM RELTIME_TBL;
- six |    reltime    |   interval    
------+---------------+---------------
-     | @ 1 min       | @ 1 min
-     | @ 5 hours     | @ 5 hours
-     | @ 10 days     | @ 10 days
-     | @ 34 years    | @ 34 years
-     | @ 3 mons      | @ 3 mons
-     | @ 14 secs ago | @ 14 secs ago
-(6 rows)
-
 DROP TABLE TEMP_TIMESTAMP;
 --
 -- Formats
@@ -2292,18 +2154,6 @@ SELECT '' AS "64", d1 AS us_postgres FROM TIMESTAMP_TBL;
     | Mon Jan 01 17:32:01 2001
 (65 rows)
 
-SELECT '' AS seven, f1 AS us_postgres FROM ABSTIME_TBL;
- seven |         us_postgres          
--------+------------------------------
-       | Sun Jan 14 03:14:21 1973 PST
-       | Mon May 01 00:30:30 1995 PDT
-       | Wed Dec 31 16:00:00 1969 PST
-       | infinity
-       | -infinity
-       | Sat May 10 23:59:12 1947 PST
-       | invalid
-(7 rows)
-
 SET DateStyle TO 'US,ISO';
 SELECT '' AS "64", d1 AS us_iso FROM TIMESTAMP_TBL;
  64 |         us_iso         
@@ -2375,18 +2225,6 @@ SELECT '' AS "64", d1 AS us_iso FROM TIMESTAMP_TBL;
     | 2001-01-01 17:32:01
 (65 rows)
 
-SELECT '' AS seven, f1 AS us_iso FROM ABSTIME_TBL;
- seven |         us_iso         
--------+------------------------
-       | 1973-01-14 03:14:21-08
-       | 1995-05-01 00:30:30-07
-       | 1969-12-31 16:00:00-08
-       | infinity
-       | -infinity
-       | 1947-05-10 23:59:12-08
-       | invalid
-(7 rows)
-
 SET DateStyle TO 'US,SQL';
 SHOW DateStyle;
  DateStyle 
@@ -2464,18 +2302,6 @@ SELECT '' AS "64", d1 AS us_sql FROM TIMESTAMP_TBL;
     | 01/01/2001 17:32:01
 (65 rows)
 
-SELECT '' AS seven, f1 AS us_sql FROM ABSTIME_TBL;
- seven |         us_sql          
--------+-------------------------
-       | 01/14/1973 03:14:21 PST
-       | 05/01/1995 00:30:30 PDT
-       | 12/31/1969 16:00:00 PST
-       | infinity
-       | -infinity
-       | 05/10/1947 23:59:12 PST
-       | invalid
-(7 rows)
-
 SET DateStyle TO 'European,Postgres';
 SHOW DateStyle;
    DateStyle   
@@ -2561,18 +2387,6 @@ SELECT '' AS "65", d1 AS european_postgres FROM TIMESTAMP_TBL;
     | Thu 13 Jun 00:00:00 1957
 (66 rows)
 
-SELECT '' AS seven, f1 AS european_postgres FROM ABSTIME_TBL;
- seven |      european_postgres       
--------+------------------------------
-       | Sun 14 Jan 03:14:21 1973 PST
-       | Mon 01 May 00:30:30 1995 PDT
-       | Wed 31 Dec 16:00:00 1969 PST
-       | infinity
-       | -infinity
-       | Sat 10 May 23:59:12 1947 PST
-       | invalid
-(7 rows)
-
 SET DateStyle TO 'European,ISO';
 SHOW DateStyle;
  DateStyle 
@@ -2651,18 +2465,6 @@ SELECT '' AS "65", d1 AS european_iso FROM TIMESTAMP_TBL;
     | 1957-06-13 00:00:00
 (66 rows)
 
-SELECT '' AS seven, f1 AS european_iso FROM ABSTIME_TBL;
- seven |      european_iso      
--------+------------------------
-       | 1973-01-14 03:14:21-08
-       | 1995-05-01 00:30:30-07
-       | 1969-12-31 16:00:00-08
-       | infinity
-       | -infinity
-       | 1947-05-10 23:59:12-08
-       | invalid
-(7 rows)
-
 SET DateStyle TO 'European,SQL';
 SHOW DateStyle;
  DateStyle 
@@ -2741,18 +2543,6 @@ SELECT '' AS "65", d1 AS european_sql FROM TIMESTAMP_TBL;
     | 13/06/1957 00:00:00
 (66 rows)
 
-SELECT '' AS seven, f1 AS european_sql FROM ABSTIME_TBL;
- seven |      european_sql       
--------+-------------------------
-       | 14/01/1973 03:14:21 PST
-       | 01/05/1995 00:30:30 PDT
-       | 31/12/1969 16:00:00 PST
-       | infinity
-       | -infinity
-       | 10/05/1947 23:59:12 PST
-       | invalid
-(7 rows)
-
 RESET DateStyle;
 --
 -- to_timestamp()
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 684f7f20a86..79b6c03f619 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -520,24 +520,6 @@ int24ge(smallint,integer)
 int42ge(integer,smallint)
 oideq(oid,oid)
 oidne(oid,oid)
-abstimeeq(abstime,abstime)
-abstimene(abstime,abstime)
-abstimelt(abstime,abstime)
-abstimegt(abstime,abstime)
-abstimele(abstime,abstime)
-abstimege(abstime,abstime)
-reltimeeq(reltime,reltime)
-reltimene(reltime,reltime)
-reltimelt(reltime,reltime)
-reltimegt(reltime,reltime)
-reltimele(reltime,reltime)
-reltimege(reltime,reltime)
-tintervalleneq(tinterval,reltime)
-tintervallenne(tinterval,reltime)
-tintervallenlt(tinterval,reltime)
-tintervallengt(tinterval,reltime)
-tintervallenle(tinterval,reltime)
-tintervallenge(tinterval,reltime)
 float4eq(real,real)
 float4ne(real,real)
 float4lt(real,real)
@@ -581,12 +563,6 @@ namege(name,name)
 namene(name,name)
 oidlt(oid,oid)
 oidle(oid,oid)
-tintervaleq(tinterval,tinterval)
-tintervalne(tinterval,tinterval)
-tintervallt(tinterval,tinterval)
-tintervalgt(tinterval,tinterval)
-tintervalle(tinterval,tinterval)
-tintervalge(tinterval,tinterval)
 macaddr_eq(macaddr,macaddr)
 macaddr_lt(macaddr,macaddr)
 macaddr_le(macaddr,macaddr)
@@ -1031,9 +1007,6 @@ ORDER BY 1, 2;
  !~*  | ~*
  !~~  | ~~
  !~~* | ~~*
- #<   | #>=
- #<=  | #>
- #<>  | #=
  *<   | *>=
  *<=  | *>
  *<>  | *=
@@ -1043,7 +1016,7 @@ ORDER BY 1, 2;
  <>   | ~=
  ~<=~ | ~>~
  ~<~  | ~>=~
-(16 rows)
+(13 rows)
 
 -- A mergejoinable or hashjoinable operator must be binary, must return
 -- boolean, and must have a commutator (itself, unless it's a cross-type
diff --git a/src/test/regress/expected/reltime.out b/src/test/regress/expected/reltime.out
deleted file mode 100644
index 14fdc6aeec5..00000000000
--- a/src/test/regress/expected/reltime.out
+++ /dev/null
@@ -1,109 +0,0 @@
---
--- RELTIME
---
-CREATE TABLE RELTIME_TBL (f1 reltime);
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 1 minute');
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 5 hour');
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 10 day');
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 34 year');
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 3 months');
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 14 seconds ago');
--- badly formatted reltimes
-INSERT INTO RELTIME_TBL (f1) VALUES ('badly formatted reltime');
-ERROR:  invalid input syntax for type reltime: "badly formatted reltime"
-LINE 1: INSERT INTO RELTIME_TBL (f1) VALUES ('badly formatted reltim...
-                                             ^
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 30 eons ago');
-ERROR:  invalid input syntax for type reltime: "@ 30 eons ago"
-LINE 1: INSERT INTO RELTIME_TBL (f1) VALUES ('@ 30 eons ago');
-                                             ^
--- test reltime operators
-SELECT '' AS six, * FROM RELTIME_TBL;
- six |      f1       
------+---------------
-     | @ 1 min
-     | @ 5 hours
-     | @ 10 days
-     | @ 34 years
-     | @ 3 mons
-     | @ 14 secs ago
-(6 rows)
-
-SELECT '' AS five, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 <> reltime '@ 10 days';
- five |      f1       
-------+---------------
-      | @ 1 min
-      | @ 5 hours
-      | @ 34 years
-      | @ 3 mons
-      | @ 14 secs ago
-(5 rows)
-
-SELECT '' AS three, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 <= reltime '@ 5 hours';
- three |      f1       
--------+---------------
-       | @ 1 min
-       | @ 5 hours
-       | @ 14 secs ago
-(3 rows)
-
-SELECT '' AS three, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 < reltime '@ 1 day';
- three |      f1       
--------+---------------
-       | @ 1 min
-       | @ 5 hours
-       | @ 14 secs ago
-(3 rows)
-
-SELECT '' AS one, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 = reltime '@ 34 years';
- one |     f1     
------+------------
-     | @ 34 years
-(1 row)
-
-SELECT '' AS two, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 >= reltime '@ 1 month';
- two |     f1     
------+------------
-     | @ 34 years
-     | @ 3 mons
-(2 rows)
-
-SELECT '' AS five, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 > reltime '@ 3 seconds ago';
- five |     f1     
-------+------------
-      | @ 1 min
-      | @ 5 hours
-      | @ 10 days
-      | @ 34 years
-      | @ 3 mons
-(5 rows)
-
-SELECT '' AS fifteen, r1.*, r2.*
-   FROM RELTIME_TBL r1, RELTIME_TBL r2
-   WHERE r1.f1 > r2.f1
-   ORDER BY r1.f1, r2.f1;
- fifteen |     f1     |      f1       
----------+------------+---------------
-         | @ 1 min    | @ 14 secs ago
-         | @ 5 hours  | @ 14 secs ago
-         | @ 5 hours  | @ 1 min
-         | @ 10 days  | @ 14 secs ago
-         | @ 10 days  | @ 1 min
-         | @ 10 days  | @ 5 hours
-         | @ 3 mons   | @ 14 secs ago
-         | @ 3 mons   | @ 1 min
-         | @ 3 mons   | @ 5 hours
-         | @ 3 mons   | @ 10 days
-         | @ 34 years | @ 14 secs ago
-         | @ 34 years | @ 1 min
-         | @ 34 years | @ 5 hours
-         | @ 34 years | @ 10 days
-         | @ 34 years | @ 3 mons
-(15 rows)
-
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index f1c1b44d6fb..50938a29aca 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -1704,7 +1704,7 @@ pg_shadow| SELECT pg_authid.rolname AS usename,
     pg_authid.rolreplication AS userepl,
     pg_authid.rolbypassrls AS usebypassrls,
     pg_authid.rolpassword AS passwd,
-    (pg_authid.rolvaliduntil)::abstime AS valuntil,
+    pg_authid.rolvaliduntil AS valuntil,
     s.setconfig AS useconfig
    FROM (pg_authid
      LEFT JOIN pg_db_role_setting s ON (((pg_authid.oid = s.setrole) AND (s.setdatabase = (0)::oid))))
diff --git a/src/test/regress/expected/sanity_check.out b/src/test/regress/expected/sanity_check.out
index e9966405933..324a1739a0b 100644
--- a/src/test/regress/expected/sanity_check.out
+++ b/src/test/regress/expected/sanity_check.out
@@ -13,7 +13,6 @@ SELECT relname, relhasindex
    ORDER BY relname;
 a|f
 a_star|f
-abstime_tbl|f
 aggtest|f
 array_index_op_test|t
 array_op_test|f
@@ -169,7 +168,6 @@ quad_point_tbl|t
 radix_text_tbl|t
 ramp|f
 real_city|f
-reltime_tbl|f
 road|t
 shighway|t
 slow_emp4000|f
@@ -194,7 +192,6 @@ time_tbl|f
 timestamp_tbl|f
 timestamptz_tbl|f
 timetz_tbl|f
-tinterval_tbl|f
 varchar_tbl|f
 -- restore normal output mode
 \a\t
diff --git a/src/test/regress/expected/tinterval.out b/src/test/regress/expected/tinterval.out
deleted file mode 100644
index a0189729fc3..00000000000
--- a/src/test/regress/expected/tinterval.out
+++ /dev/null
@@ -1,172 +0,0 @@
---
--- TINTERVAL
---
-CREATE TABLE TINTERVAL_TBL (f1  tinterval);
--- Should accept any abstime,
--- so do not bother with extensive testing of values
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["-infinity" "infinity"]');
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]');
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]');
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["epoch" "Mon May  1 00:30:30 1995"]');
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["Feb 15 1990 12:15:03" "2001-09-23 11:12:13"]');
--- badly formatted tintervals
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["bad time specifications" ""]');
-ERROR:  invalid input syntax for type abstime: "bad time specifications"
-LINE 2:    VALUES ('["bad time specifications" ""]');
-                   ^
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["" "infinity"]');
-ERROR:  invalid input syntax for type abstime: ""
-LINE 2:    VALUES ('["" "infinity"]');
-                   ^
--- test tinterval operators
-SELECT '' AS five, * FROM TINTERVAL_TBL;
- five |                               f1                                
-------+-----------------------------------------------------------------
-      | ["-infinity" "infinity"]
-      | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
-      | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
-      | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-      | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"]
-(5 rows)
-
--- length ==
-SELECT '' AS one, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #= '@ 1 months';
- one |                               f1                                
------+-----------------------------------------------------------------
-     | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
-(1 row)
-
--- length <>
-SELECT '' AS three, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #<> '@ 1 months';
- three |                               f1                                
--------+-----------------------------------------------------------------
-       | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
-       | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-       | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"]
-(3 rows)
-
--- length <
-SELECT '' AS zero, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #< '@ 1 month';
- zero | f1 
-------+----
-(0 rows)
-
--- length <=
-SELECT '' AS one, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #<= '@ 1 month';
- one |                               f1                                
------+-----------------------------------------------------------------
-     | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
-(1 row)
-
--- length >
-SELECT '' AS three, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #> '@ 1 year';
- three |                               f1                                
--------+-----------------------------------------------------------------
-       | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
-       | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-       | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"]
-(3 rows)
-
--- length >=
-SELECT '' AS three, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #>= '@ 3 years';
- three |                               f1                                
--------+-----------------------------------------------------------------
-       | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
-       | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-       | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"]
-(3 rows)
-
--- overlaps
-SELECT '' AS three, t1.*
-   FROM TINTERVAL_TBL t1
-   WHERE t1.f1 &&
-        tinterval '["Aug 15 14:23:19 1983" "Sep 16 14:23:19 1983"]';
- three |                               f1                                
--------+-----------------------------------------------------------------
-       | ["-infinity" "infinity"]
-       | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
-       | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-(3 rows)
-
-SELECT '' AS five, t1.f1, t2.f1
-   FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2
-   WHERE t1.f1 && t2.f1 and
-         t1.f1 = t2.f1
-   ORDER BY t1.f1, t2.f1;
- five |                               f1                                |                               f1                                
-------+-----------------------------------------------------------------+-----------------------------------------------------------------
-      | ["-infinity" "infinity"]                                        | ["-infinity" "infinity"]
-      | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
-      | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"]
-      | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-      | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
-(5 rows)
-
-SELECT '' AS fourteen, t1.f1 AS interval1, t2.f1 AS interval2
-   FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2
-   WHERE t1.f1 && t2.f1 and not t1.f1 = t2.f1
-   ORDER BY interval1, interval2;
- fourteen |                            interval1                            |                            interval2                            
-----------+-----------------------------------------------------------------+-----------------------------------------------------------------
-          | ["-infinity" "infinity"]                                        | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
-          | ["-infinity" "infinity"]                                        | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"]
-          | ["-infinity" "infinity"]                                        | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-          | ["-infinity" "infinity"]                                        | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
-          | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] | ["-infinity" "infinity"]
-          | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-          | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] | ["-infinity" "infinity"]
-          | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-          | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["-infinity" "infinity"]
-          | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
-          | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"]
-          | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
-          | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] | ["-infinity" "infinity"]
-          | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-(14 rows)
-
--- contains
-SELECT '' AS five, t1.f1
-   FROM TINTERVAL_TBL t1
-   WHERE not t1.f1 <<
-        tinterval '["Aug 15 14:23:19 1980" "Sep 16 14:23:19 1990"]'
-   ORDER BY t1.f1;
- five |                               f1                                
-------+-----------------------------------------------------------------
-      | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
-      | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"]
-      | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"]
-(3 rows)
-
--- make time interval
-SELECT '' AS three, t1.f1
-   FROM TINTERVAL_TBL t1
-   WHERE t1.f1 &&
-        (abstime 'Aug 15 14:23:19 1983' <#>
-         abstime 'Sep 16 14:23:19 1983')
-   ORDER BY t1.f1;
- three |                               f1                                
--------+-----------------------------------------------------------------
-       | ["-infinity" "infinity"]
-       | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]
-       | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"]
-(3 rows)
-
diff --git a/src/test/regress/expected/triggers.out b/src/test/regress/expected/triggers.out
index 85d948741ed..29e17464d8c 100644
--- a/src/test/regress/expected/triggers.out
+++ b/src/test/regress/expected/triggers.out
@@ -273,7 +273,7 @@ drop sequence ttdummy_seq;
 --
 -- tests for per-statement triggers
 --
-CREATE TABLE log_table (tstamp timestamp default timeofday()::timestamp);
+CREATE TABLE log_table (tstamp timestamp default clock_timestamp());
 CREATE TABLE main_table (a int unique, b int);
 COPY main_table (a,b) FROM stdin;
 CREATE FUNCTION trigger_func() RETURNS trigger LANGUAGE plpgsql AS '
diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule
index e224977791e..a6c646a55e6 100644
--- a/src/test/regress/parallel_schedule
+++ b/src/test/regress/parallel_schedule
@@ -23,7 +23,7 @@ test: numerology
 # ----------
 # The second group of parallel tests
 # ----------
-test: point lseg line box path polygon circle date time timetz timestamp timestamptz interval abstime reltime tinterval inet macaddr macaddr8 tstypes
+test: point lseg line box path polygon circle date time timetz timestamp timestamptz interval inet macaddr macaddr8 tstypes
 
 # ----------
 # Another group of parallel tests
diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule
index 9fc5f1a2688..5fa7c41c581 100644
--- a/src/test/regress/serial_schedule
+++ b/src/test/regress/serial_schedule
@@ -36,9 +36,6 @@ test: timetz
 test: timestamp
 test: timestamptz
 test: interval
-test: abstime
-test: reltime
-test: tinterval
 test: inet
 test: macaddr
 test: macaddr8
diff --git a/src/test/regress/sql/abstime.sql b/src/test/regress/sql/abstime.sql
deleted file mode 100644
index 4ab821b1b8c..00000000000
--- a/src/test/regress/sql/abstime.sql
+++ /dev/null
@@ -1,67 +0,0 @@
---
--- ABSTIME
--- testing built-in time type abstime
--- uses reltime and tinterval
---
-
---
--- timezones may vary based not only on location but the operating
--- system.  the main correctness issue is that the OS may not get
--- daylight savings time right for times prior to Unix epoch (jan 1 1970).
---
-
-CREATE TABLE ABSTIME_TBL (f1 abstime);
-
-BEGIN;
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'now');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'now');
-SELECT count(*) AS two FROM ABSTIME_TBL WHERE f1 = 'now' ;
-END;
-
-DELETE FROM ABSTIME_TBL;
-
-INSERT INTO ABSTIME_TBL (f1) VALUES ('Jan 14, 1973 03:14:21');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'Mon May  1 00:30:30 1995');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'epoch');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'infinity');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime '-infinity');
-INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'May 10, 1947 23:59:12');
-
--- what happens if we specify slightly misformatted abstime?
-INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 35, 1946 10:00:00');
-INSERT INTO ABSTIME_TBL (f1) VALUES ('Feb 28, 1984 25:08:10');
-
--- badly formatted abstimes:  these should result in invalid abstimes
-INSERT INTO ABSTIME_TBL (f1) VALUES ('bad date format');
-INSERT INTO ABSTIME_TBL (f1) VALUES ('Jun 10, 1843');
-
--- test abstime operators
-
-SELECT '' AS eight, * FROM ABSTIME_TBL;
-
-SELECT '' AS six, * FROM ABSTIME_TBL
-   WHERE ABSTIME_TBL.f1 < abstime 'Jun 30, 2001';
-
-SELECT '' AS six, * FROM ABSTIME_TBL
-   WHERE ABSTIME_TBL.f1 > abstime '-infinity';
-
-SELECT '' AS six, * FROM ABSTIME_TBL
-   WHERE abstime 'May 10, 1947 23:59:12' <> ABSTIME_TBL.f1;
-
-SELECT '' AS three, * FROM ABSTIME_TBL
-   WHERE abstime 'epoch' >= ABSTIME_TBL.f1;
-
-SELECT '' AS four, * FROM ABSTIME_TBL
-   WHERE ABSTIME_TBL.f1 <= abstime 'Jan 14, 1973 03:14:21';
-
-SELECT '' AS four, * FROM ABSTIME_TBL
-  WHERE ABSTIME_TBL.f1 <?>
-	tinterval '["Apr 1 1950 00:00:00" "Dec 30 1999 23:00:00"]';
-
-SELECT '' AS four, f1 AS abstime,
-  date_part('year', f1) AS year, date_part('month', f1) AS month,
-  date_part('day',f1) AS day, date_part('hour', f1) AS hour,
-  date_part('minute', f1) AS minute, date_part('second', f1) AS second
-  FROM ABSTIME_TBL
-  WHERE isfinite(f1)
-  ORDER BY abstime;
diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql
index 02a33ca7c40..5ba8258a72e 100644
--- a/src/test/regress/sql/alter_table.sql
+++ b/src/test/regress/sql/alter_table.sql
@@ -25,12 +25,8 @@ ALTER TABLE tmp ADD COLUMN f int2;
 
 ALTER TABLE tmp ADD COLUMN g polygon;
 
-ALTER TABLE tmp ADD COLUMN h abstime;
-
 ALTER TABLE tmp ADD COLUMN i char;
 
-ALTER TABLE tmp ADD COLUMN j abstime[];
-
 ALTER TABLE tmp ADD COLUMN k int4;
 
 ALTER TABLE tmp ADD COLUMN l tid;
@@ -50,8 +46,6 @@ ALTER TABLE tmp ADD COLUMN s path;
 
 ALTER TABLE tmp ADD COLUMN t box;
 
-ALTER TABLE tmp ADD COLUMN u tinterval;
-
 ALTER TABLE tmp ADD COLUMN v timestamp;
 
 ALTER TABLE tmp ADD COLUMN w interval;
@@ -62,13 +56,13 @@ ALTER TABLE tmp ADD COLUMN y float4[];
 
 ALTER TABLE tmp ADD COLUMN z int2[];
 
-INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
+INSERT INTO tmp (a, b, c, d, e, f, g,    i,    k, l, m, n, p, q, r, s, t,
 	v, w, x, y, z)
    VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
-        'Mon May  1 00:30:30 1995', 'c', '{Mon May  1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
+	'c',
 	314159, '(1,1)', '512',
 	'1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
-	'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["epoch" "infinity"]',
+	'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
 	'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
 
 SELECT * FROM tmp;
@@ -94,12 +88,8 @@ ALTER TABLE tmp ADD COLUMN f int2;
 
 ALTER TABLE tmp ADD COLUMN g polygon;
 
-ALTER TABLE tmp ADD COLUMN h abstime;
-
 ALTER TABLE tmp ADD COLUMN i char;
 
-ALTER TABLE tmp ADD COLUMN j abstime[];
-
 ALTER TABLE tmp ADD COLUMN k int4;
 
 ALTER TABLE tmp ADD COLUMN l tid;
@@ -119,8 +109,6 @@ ALTER TABLE tmp ADD COLUMN s path;
 
 ALTER TABLE tmp ADD COLUMN t box;
 
-ALTER TABLE tmp ADD COLUMN u tinterval;
-
 ALTER TABLE tmp ADD COLUMN v timestamp;
 
 ALTER TABLE tmp ADD COLUMN w interval;
@@ -131,13 +119,13 @@ ALTER TABLE tmp ADD COLUMN y float4[];
 
 ALTER TABLE tmp ADD COLUMN z int2[];
 
-INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
+INSERT INTO tmp (a, b, c, d, e, f, g,    i,   k, l, m, n, p, q, r, s, t,
 	v, w, x, y, z)
    VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
-        'Mon May  1 00:30:30 1995', 'c', '{Mon May  1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
+        'c',
 	314159, '(1,1)', '512',
 	'1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
-	'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["epoch" "infinity"]',
+	'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)',
 	'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
 
 SELECT * FROM tmp;
diff --git a/src/test/regress/sql/horology.sql b/src/test/regress/sql/horology.sql
index a7bc9dcfc4f..0800fcef2d1 100644
--- a/src/test/regress/sql/horology.sql
+++ b/src/test/regress/sql/horology.sql
@@ -267,35 +267,6 @@ SELECT '' AS "226", d1.f1 AS timestamp1, d2.f1 AS timestamp2, d1.f1 - d2.f1 AS d
   FROM TEMP_TIMESTAMP d1, TEMP_TIMESTAMP d2
   ORDER BY timestamp1, timestamp2, difference;
 
---
--- abstime, reltime arithmetic
---
-
-SELECT '' AS ten, ABSTIME_TBL.f1 AS abstime, RELTIME_TBL.f1 AS reltime
-    FROM ABSTIME_TBL, RELTIME_TBL
-   WHERE (ABSTIME_TBL.f1 + RELTIME_TBL.f1) < abstime 'Jan 14 14:00:00 1971'
-   ORDER BY abstime, reltime;
-
--- these four queries should return the same answer
--- the "infinity" and "-infinity" tuples in ABSTIME_TBL cannot be added and
--- therefore, should not show up in the results.
-
-SELECT '' AS three, * FROM ABSTIME_TBL
-  WHERE  (ABSTIME_TBL.f1 + reltime '@ 3 year')         -- +3 years
-    < abstime 'Jan 14 14:00:00 1977';
-
-SELECT '' AS three, * FROM ABSTIME_TBL
-   WHERE  (ABSTIME_TBL.f1 + reltime '@ 3 year ago')    -- -3 years
-     < abstime 'Jan 14 14:00:00 1971';
-
-SELECT '' AS three, * FROM ABSTIME_TBL
-   WHERE  (ABSTIME_TBL.f1 - reltime '@ 3 year')        -- -(+3) years
-    < abstime 'Jan 14 14:00:00 1971';
-
-SELECT '' AS three, * FROM ABSTIME_TBL
-   WHERE  (ABSTIME_TBL.f1 - reltime '@ 3 year ago')    -- -(-3) years
-     < abstime 'Jan 14 14:00:00 1977';
-
 --
 -- Conversions
 --
@@ -305,27 +276,6 @@ SELECT '' AS "16", f1 AS "timestamp", date(f1) AS date
   WHERE f1 <> timestamp 'now'
   ORDER BY date, "timestamp";
 
-SELECT '' AS "16", f1 AS "timestamp", abstime(f1) AS abstime
-  FROM TEMP_TIMESTAMP
-  ORDER BY abstime;
-
-SELECT '' AS four, f1 AS abstime, date(f1) AS date
-  FROM ABSTIME_TBL
-  WHERE isfinite(f1) AND f1 <> abstime 'now'
-  ORDER BY date, abstime;
-
-SELECT '' AS two, d1 AS "timestamp", abstime(d1) AS abstime
-  FROM TIMESTAMP_TBL WHERE NOT isfinite(d1);
-
-SELECT '' AS three, f1 as abstime, cast(f1 as timestamp) AS "timestamp"
-  FROM ABSTIME_TBL WHERE NOT isfinite(f1);
-
-SELECT '' AS ten, f1 AS interval, reltime(f1) AS reltime
-  FROM INTERVAL_TBL;
-
-SELECT '' AS six, f1 as reltime, CAST(f1 AS interval) AS interval
-  FROM RELTIME_TBL;
-
 DROP TABLE TEMP_TIMESTAMP;
 
 --
@@ -338,22 +288,16 @@ SHOW DateStyle;
 
 SELECT '' AS "64", d1 AS us_postgres FROM TIMESTAMP_TBL;
 
-SELECT '' AS seven, f1 AS us_postgres FROM ABSTIME_TBL;
-
 SET DateStyle TO 'US,ISO';
 
 SELECT '' AS "64", d1 AS us_iso FROM TIMESTAMP_TBL;
 
-SELECT '' AS seven, f1 AS us_iso FROM ABSTIME_TBL;
-
 SET DateStyle TO 'US,SQL';
 
 SHOW DateStyle;
 
 SELECT '' AS "64", d1 AS us_sql FROM TIMESTAMP_TBL;
 
-SELECT '' AS seven, f1 AS us_sql FROM ABSTIME_TBL;
-
 SET DateStyle TO 'European,Postgres';
 
 SHOW DateStyle;
@@ -364,24 +308,18 @@ SELECT count(*) as one FROM TIMESTAMP_TBL WHERE d1 = 'Jun 13 1957';
 
 SELECT '' AS "65", d1 AS european_postgres FROM TIMESTAMP_TBL;
 
-SELECT '' AS seven, f1 AS european_postgres FROM ABSTIME_TBL;
-
 SET DateStyle TO 'European,ISO';
 
 SHOW DateStyle;
 
 SELECT '' AS "65", d1 AS european_iso FROM TIMESTAMP_TBL;
 
-SELECT '' AS seven, f1 AS european_iso FROM ABSTIME_TBL;
-
 SET DateStyle TO 'European,SQL';
 
 SHOW DateStyle;
 
 SELECT '' AS "65", d1 AS european_sql FROM TIMESTAMP_TBL;
 
-SELECT '' AS seven, f1 AS european_sql FROM ABSTIME_TBL;
-
 RESET DateStyle;
 
 --
diff --git a/src/test/regress/sql/reltime.sql b/src/test/regress/sql/reltime.sql
deleted file mode 100644
index a07b64e29d8..00000000000
--- a/src/test/regress/sql/reltime.sql
+++ /dev/null
@@ -1,50 +0,0 @@
---
--- RELTIME
---
-
-CREATE TABLE RELTIME_TBL (f1 reltime);
-
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 1 minute');
-
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 5 hour');
-
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 10 day');
-
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 34 year');
-
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 3 months');
-
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 14 seconds ago');
-
-
--- badly formatted reltimes
-INSERT INTO RELTIME_TBL (f1) VALUES ('badly formatted reltime');
-
-INSERT INTO RELTIME_TBL (f1) VALUES ('@ 30 eons ago');
-
--- test reltime operators
-
-SELECT '' AS six, * FROM RELTIME_TBL;
-
-SELECT '' AS five, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 <> reltime '@ 10 days';
-
-SELECT '' AS three, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 <= reltime '@ 5 hours';
-
-SELECT '' AS three, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 < reltime '@ 1 day';
-
-SELECT '' AS one, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 = reltime '@ 34 years';
-
-SELECT '' AS two, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 >= reltime '@ 1 month';
-
-SELECT '' AS five, * FROM RELTIME_TBL
-   WHERE RELTIME_TBL.f1 > reltime '@ 3 seconds ago';
-
-SELECT '' AS fifteen, r1.*, r2.*
-   FROM RELTIME_TBL r1, RELTIME_TBL r2
-   WHERE r1.f1 > r2.f1
-   ORDER BY r1.f1, r2.f1;
diff --git a/src/test/regress/sql/tinterval.sql b/src/test/regress/sql/tinterval.sql
deleted file mode 100644
index 42399ce694a..00000000000
--- a/src/test/regress/sql/tinterval.sql
+++ /dev/null
@@ -1,97 +0,0 @@
---
--- TINTERVAL
---
-
-CREATE TABLE TINTERVAL_TBL (f1  tinterval);
-
--- Should accept any abstime,
--- so do not bother with extensive testing of values
-
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["-infinity" "infinity"]');
-
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]');
-
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]');
-
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["epoch" "Mon May  1 00:30:30 1995"]');
-
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["Feb 15 1990 12:15:03" "2001-09-23 11:12:13"]');
-
-
--- badly formatted tintervals
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["bad time specifications" ""]');
-
-INSERT INTO TINTERVAL_TBL (f1)
-   VALUES ('["" "infinity"]');
-
--- test tinterval operators
-
-SELECT '' AS five, * FROM TINTERVAL_TBL;
-
--- length ==
-SELECT '' AS one, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #= '@ 1 months';
-
--- length <>
-SELECT '' AS three, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #<> '@ 1 months';
-
--- length <
-SELECT '' AS zero, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #< '@ 1 month';
-
--- length <=
-SELECT '' AS one, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #<= '@ 1 month';
-
--- length >
-SELECT '' AS three, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #> '@ 1 year';
-
--- length >=
-SELECT '' AS three, t.*
-   FROM TINTERVAL_TBL t
-   WHERE t.f1 #>= '@ 3 years';
-
--- overlaps
-SELECT '' AS three, t1.*
-   FROM TINTERVAL_TBL t1
-   WHERE t1.f1 &&
-        tinterval '["Aug 15 14:23:19 1983" "Sep 16 14:23:19 1983"]';
-
-SELECT '' AS five, t1.f1, t2.f1
-   FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2
-   WHERE t1.f1 && t2.f1 and
-         t1.f1 = t2.f1
-   ORDER BY t1.f1, t2.f1;
-
-SELECT '' AS fourteen, t1.f1 AS interval1, t2.f1 AS interval2
-   FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2
-   WHERE t1.f1 && t2.f1 and not t1.f1 = t2.f1
-   ORDER BY interval1, interval2;
-
--- contains
-SELECT '' AS five, t1.f1
-   FROM TINTERVAL_TBL t1
-   WHERE not t1.f1 <<
-        tinterval '["Aug 15 14:23:19 1980" "Sep 16 14:23:19 1990"]'
-   ORDER BY t1.f1;
-
--- make time interval
-SELECT '' AS three, t1.f1
-   FROM TINTERVAL_TBL t1
-   WHERE t1.f1 &&
-        (abstime 'Aug 15 14:23:19 1983' <#>
-         abstime 'Sep 16 14:23:19 1983')
-   ORDER BY t1.f1;
diff --git a/src/test/regress/sql/triggers.sql b/src/test/regress/sql/triggers.sql
index 2b2236ed7d9..ff73d54d62e 100644
--- a/src/test/regress/sql/triggers.sql
+++ b/src/test/regress/sql/triggers.sql
@@ -206,7 +206,7 @@ drop sequence ttdummy_seq;
 -- tests for per-statement triggers
 --
 
-CREATE TABLE log_table (tstamp timestamp default timeofday()::timestamp);
+CREATE TABLE log_table (tstamp timestamp default clock_timestamp());
 
 CREATE TABLE main_table (a int unique, b int);
 
-- 
2.14.1.536.g6867272d5b.dirty

