Something for the TODO list: deprecating abstime and friends

Started by Tom Laneover 8 years ago38 messages
#1Tom Lane
tgl@sss.pgh.pa.us

The types abstime, reltime, and tinterval need to go away, or be
reimplemented, sometime well before 2038 when they will overflow.
It's not too soon to start having a plan for that, especially seeing
that it seems to take a decade or more for us to actually get rid
of anything we've deprecated.

Right offhand, I don't think there is any functionality in these
types that isn't handled as well or better by timestamptz, interval,
and tstzrange respectively. And they're basically undocumented
except for a sort-of deprecation notice just above section 8.5.1.
So my inclination is to remove them rather than try to upgrade them
in any way. However, we'd have to do something about:

* The legacy system views pg_shadow and pg_user have abstime columns.
Experimentation suggests that we could convert those to timestamptz(0)
and the output format wouldn't change, so maybe that's a good enough
fix there.

* contrib/spi/timetravel depends on abstime columns to represent what
would nowadays be better done as a tstzrange. I'd have thought we
could maybe toss that example module overboard, but we just today got
a question about its usage, so I'm afraid it's not quite dead yet.
What shall we do with that?

While it's too late in the v10 cycle to do anything very meaningful
about this now, I am tempted to strengthen the deprecation notice's
wording from "might disappear" to "will disappear". And it's not good
that the documentation of contrib/spi/timetravel contains nothing
whatever pointing out the lack of future-proof-ness of abstime.

Thoughts?

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#1)
Re: Something for the TODO list: deprecating abstime and friends

On Sat, Jul 15, 2017 at 6:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Right offhand, I don't think there is any functionality in these
types that isn't handled as well or better by timestamptz, interval,
and tstzrange respectively. And they're basically undocumented
except for a sort-of deprecation notice just above section 8.5.1.
So my inclination is to remove them rather than try to upgrade them
in any way. However, we'd have to do something about:

* The legacy system views pg_shadow and pg_user have abstime columns.
Experimentation suggests that we could convert those to timestamptz(0)
and the output format wouldn't change, so maybe that's a good enough
fix there.

+1 for doing that in v11.

* contrib/spi/timetravel depends on abstime columns to represent what
would nowadays be better done as a tstzrange. I'd have thought we
could maybe toss that example module overboard, but we just today got
a question about its usage, so I'm afraid it's not quite dead yet.
What shall we do with that?

No idea. I think if nobody's willing to come up with a plan for this
and do the work to implement it, we should just remove the module when
we get closer to 2038. But I don't think we have to make that
decision for at least another 5 years or so.

While it's too late in the v10 cycle to do anything very meaningful
about this now, I am tempted to strengthen the deprecation notice's
wording from "might disappear" to "will disappear".

-1 for changing that; such predictions often turn out to be wrong.

And it's not good
that the documentation of contrib/spi/timetravel contains nothing
whatever pointing out the lack of future-proof-ness of abstime.

+1 for fixing that, though. Maybe we can find a wording that says in
effect "this module will need to be removed or fixed sometime not too
many years from now; if you care about keeping it around, maybe you
should volunteer to do the necessary fixing".

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#2)
Re: Something for the TODO list: deprecating abstime and friends

Robert Haas <robertmhaas@gmail.com> writes:

On Sat, Jul 15, 2017 at 6:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

* contrib/spi/timetravel depends on abstime columns to represent what
would nowadays be better done as a tstzrange. I'd have thought we
could maybe toss that example module overboard, but we just today got
a question about its usage, so I'm afraid it's not quite dead yet.
What shall we do with that?

No idea. I think if nobody's willing to come up with a plan for this
and do the work to implement it, we should just remove the module when
we get closer to 2038. But I don't think we have to make that
decision for at least another 5 years or so.

The plan I'd tentatively suggest is to just s/abstime/timestamptz/g
in the timetravel module, something that would be unlikely to take more
than an hour's work. If anyone was actually using it in production
they'd have to do some ALTER COLUMN TYPE changes before the trigger
would work again ... but that would get forced on them eventually
anyway. Yup, you could turn this molehill into a mountain of work
if you wanted to have a more friendly transition, but I don't see
anyone putting in that much effort.

While it's too late in the v10 cycle to do anything very meaningful
about this now, I am tempted to strengthen the deprecation notice's
wording from "might disappear" to "will disappear".

-1 for changing that; such predictions often turn out to be wrong.

Those types will definitely fail for all use-cases in 2038, and for
many use-cases significantly before that; there's no uncertainty in that
prediction. The only way they aren't going to disappear before 2038 is
if the project is defunct first, or if somebody is sufficiently concerned
with having an easier migration path that they are willing to design and
implement one. I don't believe any of the usual suspects are going to do
that. But if there's somebody who would care enough to de-lurk and make
it happen, they'd be much more likely to do so soon enough if there's some
advance warning in the docs. Or in other words, I don't want to go from
"might disappear" in vN to gone in vN+1 with no intermediate state.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Greg Stark
stark@mit.edu
In reply to: Tom Lane (#1)
Re: Something for the TODO list: deprecating abstime and friends

On 15 July 2017 at 23:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:

While it's too late in the v10 cycle to do anything very meaningful
about this now, I am tempted to strengthen the deprecation notice's
wording from "might disappear" to "will disappear".

"Will certainly disappear at some unspecified date" is a lot less
convincing than "will disappear in 2021 in Postgres 14". The specific
year and version number is irrelevant
but picking and naming a specific one makes it a lot easier to follow
through come that date.

--
greg

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#3)
Re: Something for the TODO list: deprecating abstime and friends

On Sun, Jul 16, 2017 at 1:03 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Or in other words, I don't want to go from
"might disappear" in vN to gone in vN+1 with no intermediate state.

I see no problem with that. First, we remove things all the time with
no deprecation warning at all when we judge that they are dead enough,
or just unsalvageable. Second, if we have said that something might
disappear and then it disappears, anyone who is unhappy about that is
being unreasonable.

In other words, I don't want to have a project policy that we will not
only put a deprecation notice on everything we remove, but it will
always be worded in a certain way. If you're trying to streamline the
process of deprecating features, that's going in the exact wrong
direction.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Michael Paquier
michael.paquier@gmail.com
In reply to: Greg Stark (#4)
Re: Something for the TODO list: deprecating abstime and friends

On Sun, Jul 16, 2017 at 10:27 PM, Greg Stark <stark@mit.edu> wrote:

On 15 July 2017 at 23:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:

While it's too late in the v10 cycle to do anything very meaningful
about this now, I am tempted to strengthen the deprecation notice's
wording from "might disappear" to "will disappear".

"Will certainly disappear at some unspecified date" is a lot less
convincing than "will disappear in 2021 in Postgres 14". The specific
year and version number is irrelevant
but picking and naming a specific one makes it a lot easier to follow
through come that date.

Exactly, having an exact deprecation policy would be nice. Of course
this depends on the feature we are talking about. pg_dump for example
supports servers older than what community still supports. But in most
cases, like in core data types, it would be rather safe to say that it
gets deprecated once all the versions supported by community share the
same state (remember for example 17d436d2 that was kept around for a
rather long time, or the handling of opaque function types for
triggers and PLs still present for 15 years).

Coming back to this thread... Removing abstime and reltime sounds like
the good answer to conclude this thread once the deprecation period
expires.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Robert Haas
robertmhaas@gmail.com
In reply to: Michael Paquier (#6)
Re: Something for the TODO list: deprecating abstime and friends

On Mon, Jul 17, 2017 at 11:37 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:

Exactly, having an exact deprecation policy would be nice. Of course
this depends on the feature we are talking about. pg_dump for example
supports servers older than what community still supports. But in most
cases, like in core data types, it would be rather safe to say that it
gets deprecated once all the versions supported by community share the
same state (remember for example 17d436d2 that was kept around for a
rather long time, or the handling of opaque function types for
triggers and PLs still present for 15 years).

Yeah, but historically it never works out. A relatively famous
example is contrib/xml2, whose documentation says:

==
From PostgreSQL 8.3 on, there is XML-related functionality based on
the SQL/XML standard in the core server. That functionality covers XML
syntax checking and XPath queries, which is what this module does, and
more, but the API is not at all compatible. It is planned that this
module will be removed in a future version of PostgreSQL in favor of
the newer standard API, so you are encouraged to try converting your
applications. If you find that some of the functionality of this
module is not available in an adequate form with the newer API, please
explain your issue to <pgsql-hackers@postgresql.org> so that the
deficiency can be addressed.
==

But until 3163baa6d2d12c28f45fec60ab313537ea9a43a4 (February 24,
2013), it said that it would be removed in PostgreSQL 8.4 (July 1,
2009), a promise that could not be fulfilled without the use of a
serviceable time machine. I proposed removing contrib/xml2 sometime
during the 8.4 or 9.0 cycle, IIRC, and got told "no". While the
updated deprecation notice is less-obviously wrong, saying that
removal is "planned" is a pretty generous assessment. It's unclear
that we've made any progress in addressing whatever the problems were
that caused the previous attempt at removal to get shot down, so it
might still be wrong: maybe xml2 is going to stick around until the
heat death of the universe.

Now, I agree that a date type which cannot represent dates after 2038
is of marginal and decreasing utility, and therefore the chances that
it will be removed are good. Probably most other people will agree as
well. But we could easily overlook the need to deliver on a promise
to remove it in a specific version, and the possibility that someone
will argue for keeping it as a matter of historical interest cannot be
ruled out. In a community where anything at all can be relitigated at
the drop of a hat, making promises about what will happen in the
future is mostly wishful thinking.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#8Mark Dilger
hornschnorter@gmail.com
In reply to: Tom Lane (#1)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 15, 2017, at 3:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

The types abstime, reltime, and tinterval need to go away, or be
reimplemented, sometime well before 2038 when they will overflow.
It's not too soon to start having a plan for that, especially seeing
that it seems to take a decade or more for us to actually get rid
of anything we've deprecated.

Right offhand, I don't think there is any functionality in these
types that isn't handled as well or better by timestamptz, interval,
and tstzrange respectively.

These types provide a 4-byte datatype for storing real-world second
precision timestamps, as occur in many log files. Forcing people to
switch to timestamp or timestamptz will incur a 4 byte per row
penalty. In my own builds, I have changed the epoch on these so
they won't wrap until sometime after 2100 C.E. I see little point in
switching to an 8-byte millisecond precision datatype when a perfectly
good 4-byte second precision datatype already serves the purpose.

That said, I am fully aware that these are deprecated and expect you
will remove them, at which time I'll have to keep them in my tree
and politely refuse to merge in your change which removes them.

mark

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#9Mark Dilger
hornschnorter@gmail.com
In reply to: Mark Dilger (#8)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 17, 2017, at 12:54 PM, Mark Dilger <hornschnorter@gmail.com> wrote:

On Jul 15, 2017, at 3:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

The types abstime, reltime, and tinterval need to go away, or be
reimplemented, sometime well before 2038 when they will overflow.
It's not too soon to start having a plan for that, especially seeing
that it seems to take a decade or more for us to actually get rid
of anything we've deprecated.

Right offhand, I don't think there is any functionality in these
types that isn't handled as well or better by timestamptz, interval,
and tstzrange respectively.

These types provide a 4-byte datatype for storing real-world second
precision timestamps, as occur in many log files. Forcing people to
switch to timestamp or timestamptz will incur a 4 byte per row
penalty. In my own builds, I have changed the epoch on these so
they won't wrap until sometime after 2100 C.E. I see little point in
switching to an 8-byte millisecond precision datatype when a perfectly
good 4-byte second precision datatype already serves the purpose.

That said, I am fully aware that these are deprecated and expect you
will remove them, at which time I'll have to keep them in my tree
and politely refuse to merge in your change which removes them.

Oh, and if you could be so kind, please remove them in a commit that
does nothing else. It's much easier to skip the commit that way.

Thanks!

mark

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mark Dilger (#9)
Re: Something for the TODO list: deprecating abstime and friends

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 17, 2017, at 12:54 PM, Mark Dilger <hornschnorter@gmail.com> wrote:

On Jul 15, 2017, at 3:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

The types abstime, reltime, and tinterval need to go away, or be
reimplemented, sometime well before 2038 when they will overflow.

These types provide a 4-byte datatype for storing real-world second
precision timestamps, as occur in many log files. Forcing people to
switch to timestamp or timestamptz will incur a 4 byte per row
penalty. In my own builds, I have changed the epoch on these so
they won't wrap until sometime after 2100 C.E. I see little point in
switching to an 8-byte millisecond precision datatype when a perfectly
good 4-byte second precision datatype already serves the purpose.

Well, if you or somebody is willing to do the legwork, I'd be on board
with a plan that says that every 68 years we redefine the origin of
abstime. I imagine it could be done so that currently-stored abstime
values retain their present meaning as long as they're not too old.
For example the initial change would toss abstimes before 1970 overboard,
repurposing that range of values as being 2038-2106, but values between
1970 and 2038 still mean the same as they do today. If anybody still
cares in circa 2085, we toss 1970-2038 overboard and move the origin
again, lather rinse repeat.

But we're already past the point where it would be time to make the
first such switch, if we're gonna do it. So I'd like to see somebody
step up to the plate sooner not later.

I'd be inclined to toss reltime and tinterval overboard in any case.

Oh, and if you could be so kind, please remove them in a commit that
does nothing else. It's much easier to skip the commit that way.

We doubtless would do that, but you're fooling yourself if you imagine
that you can maintain such a fork for long while still tracking the
community version otherwise. Once those hand-assigned OIDs are free
they'll soon be absorbed by future feature patches, and then you'll
have enormous merge problems.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#11Mark Dilger
hornschnorter@gmail.com
In reply to: Tom Lane (#10)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 17, 2017, at 2:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 17, 2017, at 12:54 PM, Mark Dilger <hornschnorter@gmail.com> wrote:

On Jul 15, 2017, at 3:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

The types abstime, reltime, and tinterval need to go away, or be
reimplemented, sometime well before 2038 when they will overflow.

These types provide a 4-byte datatype for storing real-world second
precision timestamps, as occur in many log files. Forcing people to
switch to timestamp or timestamptz will incur a 4 byte per row
penalty. In my own builds, I have changed the epoch on these so
they won't wrap until sometime after 2100 C.E. I see little point in
switching to an 8-byte millisecond precision datatype when a perfectly
good 4-byte second precision datatype already serves the purpose.

Well, if you or somebody is willing to do the legwork, I'd be on board
with a plan that says that every 68 years we redefine the origin of
abstime. I imagine it could be done so that currently-stored abstime
values retain their present meaning as long as they're not too old.
For example the initial change would toss abstimes before 1970 overboard,
repurposing that range of values as being 2038-2106, but values between
1970 and 2038 still mean the same as they do today. If anybody still
cares in circa 2085, we toss 1970-2038 overboard and move the origin
again, lather rinse repeat.

But we're already past the point where it would be time to make the
first such switch, if we're gonna do it. So I'd like to see somebody
step up to the plate sooner not later.

Assuming other members of the community would not object to such
a plan, I'd be willing to step up to that plate. I'll wait a respectable time,
maybe until tomorrow, to allow others to speak up.

I'd be inclined to toss reltime and tinterval overboard in any case.

Yeah, I don't use those either, preferring to cast abstime to timestamp
(or timestamptz) prior to doing any math on them.

Oh, and if you could be so kind, please remove them in a commit that
does nothing else. It's much easier to skip the commit that way.

We doubtless would do that, but you're fooling yourself if you imagine
that you can maintain such a fork for long while still tracking the
community version otherwise. Once those hand-assigned OIDs are free
they'll soon be absorbed by future feature patches, and then you'll
have enormous merge problems.

Oh, not so much. Knowing that they were going to be deprecated, I
already moved the Oids for these to something higher than 10000. In
my own builds, the Oid generator does not assign Oids lower than 65536,
which leaves room for me to assign in the 10000-65535 range without
merge headaches. It would, however, be simpler if the types did not
go away, as that would cause minor merge headaches elsewhere, such
as in the regression tests.

mark

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#12Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mark Dilger (#11)
Re: Something for the TODO list: deprecating abstime and friends

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 17, 2017, at 2:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Well, if you or somebody is willing to do the legwork, I'd be on board
with a plan that says that every 68 years we redefine the origin of
abstime. I imagine it could be done so that currently-stored abstime
values retain their present meaning as long as they're not too old.
For example the initial change would toss abstimes before 1970 overboard,
repurposing that range of values as being 2038-2106, but values between
1970 and 2038 still mean the same as they do today. If anybody still
cares in circa 2085, we toss 1970-2038 overboard and move the origin
again, lather rinse repeat.

Assuming other members of the community would not object to such
a plan, I'd be willing to step up to that plate.

So, thinking about how that would actually work ... the thing to do in
order to preserve existing on-disk values is to alternate between signed
and unsigned interpretations of abstimes. That is, right now, abstime
is signed with origin 1970. The conversion I'm arguing we should make
real soon now is to unsigned with origin 1970. If the project lives
so long, in circa 70 years we'd switch it to signed with origin 2106.
Yadda yadda.

Now, this should mostly work conveniently, except that we have
+/-infinity (NOEND_ABSTIME/NOSTART_ABSTIME) to deal with. Those
are nicely positioned at the ends of the signed range so that
abstime_cmp_internal() doesn't need to treat them specially.
In an unsigned world they'd be smack in the middle of the range.
We could certainly teach abstime_cmp_internal to special-case them
and deliver logically correct results, but there's a bigger problem:
those will correspond to two seconds in January 2038 that will need
to be representable when the time comes. Maybe we can make that
work by defining the values past 2038 as being two seconds less than
you might otherwise expect, but I bet it's gonna be messy. It might
be saner to just desupport +/-infinity for abstime.

The same goes for INVALID_ABSTIME, which doesn't have any clear
use-case that I know of, and is certainly not documented.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#13Mark Dilger
hornschnorter@gmail.com
In reply to: Tom Lane (#12)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 17, 2017, at 3:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 17, 2017, at 2:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Well, if you or somebody is willing to do the legwork, I'd be on board
with a plan that says that every 68 years we redefine the origin of
abstime. I imagine it could be done so that currently-stored abstime
values retain their present meaning as long as they're not too old.
For example the initial change would toss abstimes before 1970 overboard,
repurposing that range of values as being 2038-2106, but values between
1970 and 2038 still mean the same as they do today. If anybody still
cares in circa 2085, we toss 1970-2038 overboard and move the origin
again, lather rinse repeat.

Assuming other members of the community would not object to such
a plan, I'd be willing to step up to that plate.

So, thinking about how that would actually work ... the thing to do in
order to preserve existing on-disk values is to alternate between signed
and unsigned interpretations of abstimes. That is, right now, abstime
is signed with origin 1970. The conversion I'm arguing we should make
real soon now is to unsigned with origin 1970. If the project lives
so long, in circa 70 years we'd switch it to signed with origin 2106.
Yadda yadda.

Right, I already had the same idea. That's not how I am doing it in my
fork currently, but that's what you would want to do to support any values
already stored somewhere.

Now, this should mostly work conveniently, except that we have
+/-infinity (NOEND_ABSTIME/NOSTART_ABSTIME) to deal with. Those
are nicely positioned at the ends of the signed range so that
abstime_cmp_internal() doesn't need to treat them specially.
In an unsigned world they'd be smack in the middle of the range.
We could certainly teach abstime_cmp_internal to special-case them
and deliver logically correct results, but there's a bigger problem:
those will correspond to two seconds in January 2038 that will need
to be representable when the time comes. Maybe we can make that
work by defining the values past 2038 as being two seconds less than
you might otherwise expect, but I bet it's gonna be messy. It might
be saner to just desupport +/-infinity for abstime.

I don't use those values, so it is no matter to me if we desupport them. It
seems a bit pointless, though, because we still have to handle legacy
values that we encounter. I assume some folks will have those values in
their tables when they upgrade.

The same goes for INVALID_ABSTIME, which doesn't have any clear
use-case that I know of, and is certainly not documented.

Likewise, I don't know how to desupport this while still supporting legacy
tables.

mark

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#14Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mark Dilger (#13)
Re: Something for the TODO list: deprecating abstime and friends

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 17, 2017, at 3:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Now, this should mostly work conveniently, except that we have
+/-infinity (NOEND_ABSTIME/NOSTART_ABSTIME) to deal with ... It might
be saner to just desupport +/-infinity for abstime.

I don't use those values, so it is no matter to me if we desupport them. It
seems a bit pointless, though, because we still have to handle legacy
values that we encounter. I assume some folks will have those values in
their tables when they upgrade.

Well, some folks will also have pre-1970 dates in their tables, no?
We're just blowing those off. They'll print out as some post-2038
date or other, and too bad.

Basically, the direction this is going in is that abstime will become
an officially supported type, but its range of supported values is "not
too many decades either way from now". If you are using it to store
very old dates then You're Doing It Wrong, and eventually you'll get
bitten. Given that contract, I don't see a place for +/-infinity.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#15Mark Dilger
hornschnorter@gmail.com
In reply to: Tom Lane (#14)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 17, 2017, at 3:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 17, 2017, at 3:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Now, this should mostly work conveniently, except that we have
+/-infinity (NOEND_ABSTIME/NOSTART_ABSTIME) to deal with ... It might
be saner to just desupport +/-infinity for abstime.

I don't use those values, so it is no matter to me if we desupport them. It
seems a bit pointless, though, because we still have to handle legacy
values that we encounter. I assume some folks will have those values in
their tables when they upgrade.

Well, some folks will also have pre-1970 dates in their tables, no?
We're just blowing those off. They'll print out as some post-2038
date or other, and too bad.

Basically, the direction this is going in is that abstime will become
an officially supported type, but its range of supported values is "not
too many decades either way from now". If you are using it to store
very old dates then You're Doing It Wrong, and eventually you'll get
bitten. Given that contract, I don't see a place for +/-infinity.

Works for me.

mark

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#16Mark Dilger
hornschnorter@gmail.com
In reply to: Tom Lane (#12)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 17, 2017, at 3:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 17, 2017, at 2:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Well, if you or somebody is willing to do the legwork, I'd be on board
with a plan that says that every 68 years we redefine the origin of
abstime. I imagine it could be done so that currently-stored abstime
values retain their present meaning as long as they're not too old.
For example the initial change would toss abstimes before 1970 overboard,
repurposing that range of values as being 2038-2106, but values between
1970 and 2038 still mean the same as they do today. If anybody still
cares in circa 2085, we toss 1970-2038 overboard and move the origin
again, lather rinse repeat.

Assuming other members of the community would not object to such
a plan, I'd be willing to step up to that plate.

So, thinking about how that would actually work ... the thing to do in
order to preserve existing on-disk values is to alternate between signed
and unsigned interpretations of abstimes. That is, right now, abstime
is signed with origin 1970. The conversion I'm arguing we should make
real soon now is to unsigned with origin 1970. If the project lives
so long, in circa 70 years we'd switch it to signed with origin 2106.
Yadda yadda.

Now, this should mostly work conveniently, except that we have
+/-infinity (NOEND_ABSTIME/NOSTART_ABSTIME) to deal with. Those
are nicely positioned at the ends of the signed range so that
abstime_cmp_internal() doesn't need to treat them specially.
In an unsigned world they'd be smack in the middle of the range.
We could certainly teach abstime_cmp_internal to special-case them
and deliver logically correct results, but there's a bigger problem:
those will correspond to two seconds in January 2038 that will need
to be representable when the time comes. Maybe we can make that
work by defining the values past 2038 as being two seconds less than
you might otherwise expect, but I bet it's gonna be messy. It might
be saner to just desupport +/-infinity for abstime.

The same goes for INVALID_ABSTIME, which doesn't have any clear
use-case that I know of, and is certainly not documented.

I use the abstime type in some catalog tables, and if I allowed those
fields to have something equivalent to NULL, which I do not, I would need
INVALID_ABSTIME, since NULL is not allowed in the constant header of a
catalog table.

I wonder if old versions of postgres had catalog tables with abstime used
in this way? Other than that, I can't think of a reason to use INVALID_ABSTIME.

mark

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#17Mark Dilger
hornschnorter@gmail.com
In reply to: Mark Dilger (#11)
1 attachment(s)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 17, 2017, at 2:34 PM, Mark Dilger <hornschnorter@gmail.com> wrote:

On Jul 17, 2017, at 2:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 17, 2017, at 12:54 PM, Mark Dilger <hornschnorter@gmail.com> wrote:

On Jul 15, 2017, at 3:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

The types abstime, reltime, and tinterval need to go away, or be
reimplemented, sometime well before 2038 when they will overflow.

These types provide a 4-byte datatype for storing real-world second
precision timestamps, as occur in many log files. Forcing people to
switch to timestamp or timestamptz will incur a 4 byte per row
penalty. In my own builds, I have changed the epoch on these so
they won't wrap until sometime after 2100 C.E. I see little point in
switching to an 8-byte millisecond precision datatype when a perfectly
good 4-byte second precision datatype already serves the purpose.

Well, if you or somebody is willing to do the legwork, I'd be on board
with a plan that says that every 68 years we redefine the origin of
abstime. I imagine it could be done so that currently-stored abstime
values retain their present meaning as long as they're not too old.
For example the initial change would toss abstimes before 1970 overboard,
repurposing that range of values as being 2038-2106, but values between
1970 and 2038 still mean the same as they do today. If anybody still
cares in circa 2085, we toss 1970-2038 overboard and move the origin
again, lather rinse repeat.

But we're already past the point where it would be time to make the
first such switch, if we're gonna do it. So I'd like to see somebody
step up to the plate sooner not later.

Assuming other members of the community would not object to such
a plan, I'd be willing to step up to that plate. I'll wait a respectable time,
maybe until tomorrow, to allow others to speak up.

There was not much conversation about this, so I went ahead with what
I think makes a logical first step. The attached patch removes the tinterval
datatype from the sources.

I intend to remove reltime next, and then make the changes to abstime in
a third patch.

mark

Attachments:

tinterval_abatement.patch.1application/octet-stream; name=tinterval_abatement.patch.1Download
diff --git a/src/backend/po/de.po b/src/backend/po/de.po
index 0962242..30d589a 100644
--- a/src/backend/po/de.po
+++ b/src/backend/po/de.po
@@ -20594,11 +20594,6 @@ msgstr "ungültiger Zeitzonenname: »%s«"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "kann »abstime«-Wert »invalid« nicht »timestamp« umwandeln"
 
-#: utils/adt/nabstime.c:782
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "ungültiger Status in externem »tinterval«-Wert"
-
 #: utils/adt/nabstime.c:852
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
diff --git a/src/backend/po/es.po b/src/backend/po/es.po
index 1e98ded..66be186 100644
--- a/src/backend/po/es.po
+++ b/src/backend/po/es.po
@@ -21160,11 +21160,6 @@ msgstr "nombre de huso horario no válido: «%s»"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "no se puede convertir el valor reservado de abstime «invalid» a timestamp"
 
-#: utils/adt/nabstime.c:782
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "estatus no válido en valor «tinterval» externo"
-
 #: utils/adt/nabstime.c:852
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
@@ -25281,9 +25276,6 @@ msgstr "no se puede importar un snapshot desde una base de datos diferente"
 #~ msgid "invalid input syntax for type macaddr: \"%s\""
 #~ msgstr "sintaxis de entrada no válida para tipo macaddr: «%s»"
 
-#~ msgid "invalid input syntax for type tinterval: \"%s\""
-#~ msgstr "sintaxis de entrada no válida para el tipo tinterval: «%s»"
-
 #~ msgid "invalid input syntax for type numeric: \"%s\""
 #~ msgstr "la sintaxis de entrada no es válida para el tipo numeric: «%s»"
 
diff --git a/src/backend/po/fr.po b/src/backend/po/fr.po
index c709370..4763830 100644
--- a/src/backend/po/fr.po
+++ b/src/backend/po/fr.po
@@ -19564,21 +19564,11 @@ msgstr "nom du fuseau horaire invalide : « %s »"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "ne peut pas convertir un abstime « invalid » en timestamp"
 
-#: utils/adt/nabstime.c:781
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "statut invalide dans la valeur externe « tinterval »"
-
 #: utils/adt/nabstime.c:855
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
 msgstr "ne peut pas convertir reltime « invalid » en interval"
 
-#: utils/adt/nabstime.c:1550
-#, c-format
-msgid "invalid input syntax for type tinterval: \"%s\""
-msgstr "syntaxe en entrée invalide pour le type tinterval : « %s »"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/id.po b/src/backend/po/id.po
index d5d4841..dfdbbc2 100644
--- a/src/backend/po/id.po
+++ b/src/backend/po/id.po
@@ -15760,21 +15760,11 @@ msgstr "nama zona waktu tidak valid: « %s »"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "tidak dapat mengkonversi abstime « invalid » ke timestamp"
 
-#: utils/adt/nabstime.c:807
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "status tidak valid pada nilai eksternal « tinterval »"
-
 #: utils/adt/nabstime.c:881
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
 msgstr "tidak dapat mengkonversi reltime « invalid » ke interval"
 
-#: utils/adt/nabstime.c:1576
-#, c-format
-msgid "invalid input syntax for type tinterval: \"%s\""
-msgstr "sintaks masukan tidak valid untuk tipe tinterval : « %s »"
-
 #: utils/adt/network.c:118
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/it.po b/src/backend/po/it.po
index 5f42bb4..21135e6 100644
--- a/src/backend/po/it.po
+++ b/src/backend/po/it.po
@@ -20609,11 +20609,6 @@ msgstr "il nome del fuso orario \"%s\" non è valido"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "non è possibile convertire il valore abstime \"invalid\" in timestamp"
 
-#: utils/adt/nabstime.c:782
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "lo stato nel valore del \"tinterval\" esterno non è valido"
-
 #: utils/adt/nabstime.c:852
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
diff --git a/src/backend/po/ja.po b/src/backend/po/ja.po
index 2fa5d48..8bdb383 100644
--- a/src/backend/po/ja.po
+++ b/src/backend/po/ja.po
@@ -15765,11 +15765,6 @@ msgstr "下限および上限は有限でなければなりません"
 msgid "lower bound cannot equal upper bound"
 msgstr "下限を上限と同じにできません"
 
-#: utils/adt/formatting.c:492
-#, c-format
-msgid "invalid format specification for an interval value"
-msgstr "\"tinterval\"値の書式指定が無効です"
-
 #: utils/adt/formatting.c:493
 #, c-format
 msgid "Intervals are not tied to specific calendar dates."
@@ -16510,21 +16505,11 @@ msgstr "時間帯名称が無効です: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "abstimeの\"invalid\"をtimestampに変換できません"
 
-#: utils/adt/nabstime.c:807
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "\"tinterval\"の外部値のステータスが無効です"
-
 #: utils/adt/nabstime.c:881
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
 msgstr "reltimeの\"invalid\"をintervalに変換できません"
 
-#: utils/adt/nabstime.c:1576
-#, c-format
-msgid "invalid input syntax for type tinterval: \"%s\""
-msgstr "型tintervalの入力構文が無効です: \"%s\""
-
 #: utils/adt/network.c:118
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/ko.po b/src/backend/po/ko.po
index c5225ff..9a4e045 100644
--- a/src/backend/po/ko.po
+++ b/src/backend/po/ko.po
@@ -20131,21 +20131,11 @@ msgstr "잘못된 타임존 이름: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "\"invalid\" abstime 자료형을 timestamp 자료형으로 변환할 수 없습니다."
 
-#: utils/adt/nabstime.c:781
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "외부 \"tinterval\" 값에 잘못된 상태가 있음"
-
 #: utils/adt/nabstime.c:855
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
 msgstr "reltime \"invalid\"를 interval로 변환할 수 없음"
 
-#: utils/adt/nabstime.c:1550
-#, c-format
-msgid "invalid input syntax for type tinterval: \"%s\""
-msgstr "tinterval 자료형에 대한 잘못된 입력: \"%s\""
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/pl.po b/src/backend/po/pl.po
index 3ac9d04..2162abf 100644
--- a/src/backend/po/pl.po
+++ b/src/backend/po/pl.po
@@ -21418,11 +21418,6 @@ msgstr "nieprawidłowa nazwa strefy czasowej: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "nie można przekształcić abstime \"invalid\" do znacznika czasu"
 
-#: utils/adt/nabstime.c:782
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "niepoprawny status w zewnętrznej wartości \"tinterval\""
-
 #: utils/adt/nabstime.c:852
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
@@ -25688,9 +25683,6 @@ msgstr "nie można importować migawki z innej bazy danych"
 #~ msgid "invalid input syntax for type numeric: \"%s\""
 #~ msgstr "nieprawidłowa składnia wejścia dla typu numerycznego: \"%s\""
 
-#~ msgid "invalid input syntax for type tinterval: \"%s\""
-#~ msgstr "nieprawidłowa składnia wejścia dla typu tinterval: \"%s\""
-
 #~ msgid "invalid input syntax for type macaddr: \"%s\""
 #~ msgstr "nieprawidłowa składnia wejścia dla typu macaddr: \"%s\""
 
diff --git a/src/backend/po/pt_BR.po b/src/backend/po/pt_BR.po
index 37e4a28..b3ae6fc 100644
--- a/src/backend/po/pt_BR.po
+++ b/src/backend/po/pt_BR.po
@@ -17283,21 +17283,11 @@ msgstr "nome de zona horária é inválido: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "não pode converter abstime \"invalid\" para timestamp"
 
-#: utils/adt/nabstime.c:781
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "status é inválido no valor de \"tinterval\" externo"
-
 #: utils/adt/nabstime.c:855
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
 msgstr "não pode converter reltime \"invalid\" em interval"
 
-#: utils/adt/nabstime.c:1550
-#, c-format
-msgid "invalid input syntax for type tinterval: \"%s\""
-msgstr "sintaxe de entrada é inválida para tipo tinterval: \"%s\""
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/ru.po b/src/backend/po/ru.po
index a4ce728..ca435ee 100644
--- a/src/backend/po/ru.po
+++ b/src/backend/po/ru.po
@@ -22472,11 +22472,6 @@ msgstr "неверное название часового пояса: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "преобразовать значение \"invalid\" типа abstime в timestamp нельзя"
 
-#: utils/adt/nabstime.c:782
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "неверное состояние во внешнем представлении \"tinterval\""
-
 #: utils/adt/nabstime.c:852
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
@@ -27722,9 +27717,6 @@ msgstr "Используйте для записи спецсимволов си
 #~ msgid "invalid input syntax for type macaddr: \"%s\""
 #~ msgstr "неверный синтаксис для типа macaddr: \"%s\""
 
-#~ msgid "invalid input syntax for type tinterval: \"%s\""
-#~ msgstr "неверный синтаксис для типа tinterval: \"%s\""
-
 #~ msgid "invalid input syntax for type numeric: \"%s\""
 #~ msgstr "неверный синтаксис для типа numeric: \"%s\""
 
diff --git a/src/backend/po/zh_CN.po b/src/backend/po/zh_CN.po
index 1e6934a..c5cc4b2 100644
--- a/src/backend/po/zh_CN.po
+++ b/src/backend/po/zh_CN.po
@@ -20229,21 +20229,11 @@ msgstr "无效时区名字: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "无法把 abstime \"invalid\" 转换为 timestamp."
 
-#: utils/adt/nabstime.c:781
-#, c-format
-msgid "invalid status in external \"tinterval\" value"
-msgstr "无效的外部 \"tinterval\" 值状态"
-
 #: utils/adt/nabstime.c:855
 #, c-format
 msgid "cannot convert reltime \"invalid\" to interval"
 msgstr "无法把 reltime \"invalid\" 转换为 interval"
 
-#: utils/adt/nabstime.c:1550
-#, c-format
-msgid "invalid input syntax for type tinterval: \"%s\""
-msgstr "无效的 tinterval 类型输入语法: \"%s\""
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index 2c59480..c6fa81e 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -3,7 +3,6 @@
  * 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
@@ -36,27 +35,10 @@
  * 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), \
@@ -73,10 +55,6 @@
 
 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()
@@ -693,114 +671,6 @@ reltime2tm(RelativeTime time, struct pg_tm *tm)
 }
 
 
-/*
- *		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_sendint(&buf, tinterval->status, sizeof(tinterval->status));
-	pq_sendint(&buf, tinterval->data[0], sizeof(tinterval->data[0]));
-	pq_sendint(&buf, tinterval->data[1], sizeof(tinterval->data[1]));
-	PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
-}
-
-
 /*****************************************************************************
  *	 PUBLIC ROUTINES														 *
  *****************************************************************************/
@@ -874,33 +744,6 @@ reltime_interval(PG_FUNCTION_ARGS)
 
 
 /*
- *		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
@@ -946,49 +789,6 @@ timemi(PG_FUNCTION_ARGS)
 
 
 /*
- *		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
@@ -1092,456 +892,6 @@ btreltimecmp(PG_FUNCTION_ARGS)
 	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 */
-}
-
-
 /*****************************************************************************
  *
  *****************************************************************************/
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index e103f5e..b28f428 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -3946,7 +3946,6 @@ convert_to_scalar(Datum value, Oid valuetypid, double *scaledvalue,
 		case DATEOID:
 		case INTERVALOID:
 		case RELTIMEOID:
-		case TINTERVALOID:
 		case TIMEOID:
 		case TIMETZOID:
 			*scaledvalue = convert_timevalue_to_scalar(value, valuetypid);
@@ -4379,14 +4378,6 @@ convert_timevalue_to_scalar(Datum value, Oid typid)
 			}
 		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/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h
index f850be4..6fc2f08 100644
--- a/src/include/catalog/pg_amop.h
+++ b/src/include/catalog/pg_amop.h
@@ -473,16 +473,6 @@ 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
  */
 
diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h
index 7d245b1..cca4d63 100644
--- a/src/include/catalog/pg_amproc.h
+++ b/src/include/catalog/pg_amproc.h
@@ -136,7 +136,6 @@ 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 ));
diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h
index 28dbc74..8212304 100644
--- a/src/include/catalog/pg_opclass.h
+++ b/src/include/catalog/pg_opclass.h
@@ -179,7 +179,6 @@ 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 ));
diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h
index ffabc20..d79f5f2 100644
--- a/src/include/catalog/pg_operator.h
+++ b/src/include/catalog/pg_operator.h
@@ -373,30 +373,10 @@ DATA(insert OID = 570 (  "<="	   PGNSP PGUID b f f 703 703	16 571 569 reltimele
 DESCR("less than or equal");
 DATA(insert OID = 571 (  ">="	   PGNSP PGUID b f f 703 703	16 570 568 reltimege scalargtsel scalargtjoinsel ));
 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 +405,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 +645,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 scalarltsel scalarltjoinsel ));
-DESCR("less than or equal");
-DATA(insert OID = 816 (  ">="	   PGNSP PGUID b f f 704 704	16 815 813 tintervalge scalargtsel scalargtjoinsel ));
-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 0d0ba7c..b13590a 100644
--- a/src/include/catalog/pg_opfamily.h
+++ b/src/include/catalog/pg_opfamily.h
@@ -127,7 +127,6 @@ 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 ));
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 8b33b4e..c002766 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -450,13 +450,6 @@ DATA(insert OID = 243 (  reltimeout		   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1
 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_ ));
@@ -471,18 +464,6 @@ DATA(insert OID = 259 (  reltimelt		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2
 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_ ));
@@ -634,8 +615,6 @@ DATA(insert OID = 377 (  cash_cmp		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0
 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");
 
@@ -771,8 +750,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_ ));
@@ -927,13 +904,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_ ));
@@ -1689,8 +1659,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_ ));
@@ -4042,10 +4010,6 @@ DATA(insert OID = 2464 (  reltimerecv		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s
 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 ffdb452..aab23cb 100644
--- a/src/include/catalog/pg_type.h
+++ b/src/include/catalog/pg_type.h
@@ -423,9 +423,6 @@ DESCR("absolute, limited-range date and time (Unix system time)");
 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("");
 #define UNKNOWNOID		705
@@ -486,7 +483,6 @@ DATA(insert OID = 1021 (  _float4	 PGNSP PGUID -1 f b A f t \054 0 700 0 array_i
 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/nabstime.h b/src/include/utils/nabstime.h
index 6913395..3f54ff4 100644
--- a/src/include/utils/nabstime.h
+++ b/src/include/utils/nabstime.h
@@ -36,32 +36,20 @@
 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
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 03c55d3..7e24687 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -227,8 +227,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), 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 94d2d92..e6d4843 100644
--- a/src/interfaces/ecpg/ecpglib/pg_type.h
+++ b/src/interfaces/ecpg/ecpglib/pg_type.h
@@ -40,7 +40,6 @@
 #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/test/regress/expected/abstime.out b/src/test/regress/expected/abstime.out
index ed48f64..91614da 100644
--- a/src/test/regress/expected/abstime.out
+++ b/src/test/regress/expected/abstime.out
@@ -1,7 +1,7 @@
 --
 -- ABSTIME
 -- testing built-in time type abstime
--- uses reltime and tinterval
+-- uses reltime
 --
 --
 -- timezones may vary based not only on location but the operating
@@ -109,16 +109,6 @@ SELECT '' AS four, * FROM ABSTIME_TBL
       | 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,
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index 13d6a4b..64bf68b 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -29,7 +29,7 @@ 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 u inet;
 ALTER TABLE tmp ADD COLUMN v timestamp;
 ALTER TABLE tmp ADD COLUMN w interval;
 ALTER TABLE tmp ADD COLUMN x float8[];
@@ -41,12 +41,12 @@ INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
         'Mon May  1 00:30:30 1995', 'c', '{Mon May  1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
 	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)', '192.168.1.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           |              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) | 192.168.1.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;
@@ -74,7 +74,7 @@ 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 u inet;
 ALTER TABLE tmp ADD COLUMN v timestamp;
 ALTER TABLE tmp ADD COLUMN w interval;
 ALTER TABLE tmp ADD COLUMN x float8[];
@@ -86,12 +86,12 @@ INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
         'Mon May  1 00:30:30 1995', 'c', '{Mon May  1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
 	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)', '192.168.1.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           |              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) | 192.168.1.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;
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index fcf8bd7..56a4b26 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -532,12 +532,6 @@ 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 +575,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 +1019,6 @@ ORDER BY 1, 2;
  !~*  | ~*
  !~~  | ~~
  !~~* | ~~*
- #<   | #>=
- #<=  | #>
- #<>  | #=
  *<   | *>=
  *<=  | *>
  *<>  | *=
@@ -1043,7 +1028,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/sanity_check.out b/src/test/regress/expected/sanity_check.out
index 6750152..7840c4c 100644
--- a/src/test/regress/expected/sanity_check.out
+++ b/src/test/regress/expected/sanity_check.out
@@ -190,7 +190,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 a018972..0000000
--- 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/parallel_schedule b/src/test/regress/parallel_schedule
index eefdeea..c5f9ffe 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 abstime reltime inet macaddr macaddr8 tstypes
 
 # ----------
 # Another group of parallel tests
diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule
index 76b0de3..83ba380 100644
--- a/src/test/regress/serial_schedule
+++ b/src/test/regress/serial_schedule
@@ -38,7 +38,6 @@ 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
index 4ab821b..650d7fd 100644
--- a/src/test/regress/sql/abstime.sql
+++ b/src/test/regress/sql/abstime.sql
@@ -1,7 +1,7 @@
 --
 -- ABSTIME
 -- testing built-in time type abstime
--- uses reltime and tinterval
+-- uses reltime
 --
 
 --
@@ -54,10 +54,6 @@ SELECT '' AS three, * FROM ABSTIME_TBL
 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,
diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql
index 5dd1402..361ca51 100644
--- a/src/test/regress/sql/alter_table.sql
+++ b/src/test/regress/sql/alter_table.sql
@@ -50,7 +50,7 @@ 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 u inet;
 
 ALTER TABLE tmp ADD COLUMN v timestamp;
 
@@ -68,7 +68,7 @@ INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
         'Mon May  1 00:30:30 1995', 'c', '{Mon May  1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
 	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)', '192.168.1.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;
@@ -119,7 +119,7 @@ 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 u inet;
 
 ALTER TABLE tmp ADD COLUMN v timestamp;
 
@@ -137,7 +137,7 @@ INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
         'Mon May  1 00:30:30 1995', 'c', '{Mon May  1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
 	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)', '192.168.1.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/tinterval.sql b/src/test/regress/sql/tinterval.sql
deleted file mode 100644
index 42399ce..0000000
--- 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/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 23a4bbd..cd26dc2 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -2222,8 +2222,6 @@ TidPath
 TidScan
 TidScanState
 TimeADT
-TimeInterval
-TimeIntervalData
 TimeLineHistoryCmd
 TimeLineHistoryEntry
 TimeLineID
#18Mark Dilger
hornschnorter@gmail.com
In reply to: Mark Dilger (#17)
1 attachment(s)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 18, 2017, at 9:13 PM, Mark Dilger <hornschnorter@gmail.com> wrote:

On Jul 17, 2017, at 2:34 PM, Mark Dilger <hornschnorter@gmail.com> wrote:

On Jul 17, 2017, at 2:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 17, 2017, at 12:54 PM, Mark Dilger <hornschnorter@gmail.com> wrote:

On Jul 15, 2017, at 3:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

The types abstime, reltime, and tinterval need to go away, or be
reimplemented, sometime well before 2038 when they will overflow.

These types provide a 4-byte datatype for storing real-world second
precision timestamps, as occur in many log files. Forcing people to
switch to timestamp or timestamptz will incur a 4 byte per row
penalty. In my own builds, I have changed the epoch on these so
they won't wrap until sometime after 2100 C.E. I see little point in
switching to an 8-byte millisecond precision datatype when a perfectly
good 4-byte second precision datatype already serves the purpose.

Well, if you or somebody is willing to do the legwork, I'd be on board
with a plan that says that every 68 years we redefine the origin of
abstime. I imagine it could be done so that currently-stored abstime
values retain their present meaning as long as they're not too old.
For example the initial change would toss abstimes before 1970 overboard,
repurposing that range of values as being 2038-2106, but values between
1970 and 2038 still mean the same as they do today. If anybody still
cares in circa 2085, we toss 1970-2038 overboard and move the origin
again, lather rinse repeat.

But we're already past the point where it would be time to make the
first such switch, if we're gonna do it. So I'd like to see somebody
step up to the plate sooner not later.

Assuming other members of the community would not object to such
a plan, I'd be willing to step up to that plate. I'll wait a respectable time,
maybe until tomorrow, to allow others to speak up.

There was not much conversation about this, so I went ahead with what
I think makes a logical first step. The attached patch removes the tinterval
datatype from the sources.

I intend to remove reltime next, and then make the changes to abstime in
a third patch.

As predicted, this second patch (which should be applied *after* the prior
tinterval_abatement patch) removes the reltime datatype from the sources.

mark

Attachments:

reltime_abatement.patch.1application/octet-stream; name=reltime_abatement.patch.1Download
diff --git a/src/backend/access/hash/hashvalidate.c b/src/backend/access/hash/hashvalidate.c
index 30b29cb..e7a28b0 100644
--- a/src/backend/access/hash/hashvalidate.c
+++ b/src/backend/access/hash/hashvalidate.c
@@ -292,7 +292,7 @@ check_hash_func_signature(Oid funcid, Oid restype, Oid argtype)
 		 */
 		if (funcid == F_HASHINT4 &&
 			(argtype == DATEOID ||
-			 argtype == ABSTIMEOID || argtype == RELTIMEOID ||
+			 argtype == ABSTIMEOID ||
 			 argtype == XIDOID || argtype == CIDOID))
 			 /* okay, allowed use of hashint4() */ ;
 		else if (funcid == F_TIMESTAMP_HASH &&
diff --git a/src/backend/po/de.po b/src/backend/po/de.po
index 30d589a..9a43c1f 100644
--- a/src/backend/po/de.po
+++ b/src/backend/po/de.po
@@ -20594,11 +20594,6 @@ msgstr "ungültiger Zeitzonenname: »%s«"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "kann »abstime«-Wert »invalid« nicht »timestamp« umwandeln"
 
-#: utils/adt/nabstime.c:852
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "kann »reltime«-Wert »invalid« nicht in »interval« umwandeln"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/es.po b/src/backend/po/es.po
index 66be186..24b9f69 100644
--- a/src/backend/po/es.po
+++ b/src/backend/po/es.po
@@ -21160,11 +21160,6 @@ msgstr "nombre de huso horario no válido: «%s»"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "no se puede convertir el valor reservado de abstime «invalid» a timestamp"
 
-#: utils/adt/nabstime.c:852
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "no se puede convertir el reltime «invalid» a interval"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/fr.po b/src/backend/po/fr.po
index 4763830..1a760ac 100644
--- a/src/backend/po/fr.po
+++ b/src/backend/po/fr.po
@@ -19564,11 +19564,6 @@ msgstr "nom du fuseau horaire invalide : « %s »"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "ne peut pas convertir un abstime « invalid » en timestamp"
 
-#: utils/adt/nabstime.c:855
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "ne peut pas convertir reltime « invalid » en interval"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/id.po b/src/backend/po/id.po
index dfdbbc2..166576b 100644
--- a/src/backend/po/id.po
+++ b/src/backend/po/id.po
@@ -15760,11 +15760,6 @@ msgstr "nama zona waktu tidak valid: « %s »"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "tidak dapat mengkonversi abstime « invalid » ke timestamp"
 
-#: utils/adt/nabstime.c:881
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "tidak dapat mengkonversi reltime « invalid » ke interval"
-
 #: utils/adt/network.c:118
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/it.po b/src/backend/po/it.po
index 21135e6..fd789db 100644
--- a/src/backend/po/it.po
+++ b/src/backend/po/it.po
@@ -20609,11 +20609,6 @@ msgstr "il nome del fuso orario \"%s\" non è valido"
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "non è possibile convertire il valore abstime \"invalid\" in timestamp"
 
-#: utils/adt/nabstime.c:852
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "non è possibile convertire il valore reltime \"invalid\" in interval"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/ja.po b/src/backend/po/ja.po
index 8bdb383..fc8b1e2 100644
--- a/src/backend/po/ja.po
+++ b/src/backend/po/ja.po
@@ -16505,11 +16505,6 @@ msgstr "時間帯名称が無効です: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "abstimeの\"invalid\"をtimestampに変換できません"
 
-#: utils/adt/nabstime.c:881
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "reltimeの\"invalid\"をintervalに変換できません"
-
 #: utils/adt/network.c:118
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/ko.po b/src/backend/po/ko.po
index 9a4e045..2e908ee 100644
--- a/src/backend/po/ko.po
+++ b/src/backend/po/ko.po
@@ -20131,11 +20131,6 @@ msgstr "잘못된 타임존 이름: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "\"invalid\" abstime 자료형을 timestamp 자료형으로 변환할 수 없습니다."
 
-#: utils/adt/nabstime.c:855
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "reltime \"invalid\"를 interval로 변환할 수 없음"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/pl.po b/src/backend/po/pl.po
index 2162abf..3e77e68 100644
--- a/src/backend/po/pl.po
+++ b/src/backend/po/pl.po
@@ -21418,11 +21418,6 @@ msgstr "nieprawidłowa nazwa strefy czasowej: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "nie można przekształcić abstime \"invalid\" do znacznika czasu"
 
-#: utils/adt/nabstime.c:852
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "nie można przekształcić reltime \"invalid\" do interwału"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/pt_BR.po b/src/backend/po/pt_BR.po
index b3ae6fc..3b3c1ee 100644
--- a/src/backend/po/pt_BR.po
+++ b/src/backend/po/pt_BR.po
@@ -17283,11 +17283,6 @@ msgstr "nome de zona horária é inválido: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "não pode converter abstime \"invalid\" para timestamp"
 
-#: utils/adt/nabstime.c:855
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "não pode converter reltime \"invalid\" em interval"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/ru.po b/src/backend/po/ru.po
index ca435ee..c11fb05 100644
--- a/src/backend/po/ru.po
+++ b/src/backend/po/ru.po
@@ -22472,11 +22472,6 @@ msgstr "неверное название часового пояса: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "преобразовать значение \"invalid\" типа abstime в timestamp нельзя"
 
-#: utils/adt/nabstime.c:852
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "преобразовать значение \"invalid\" типа reltime в interval нельзя"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/po/zh_CN.po b/src/backend/po/zh_CN.po
index c5cc4b2..fdf033e 100644
--- a/src/backend/po/zh_CN.po
+++ b/src/backend/po/zh_CN.po
@@ -20229,11 +20229,6 @@ msgstr "无效时区名字: \"%s\""
 msgid "cannot convert abstime \"invalid\" to timestamp"
 msgstr "无法把 abstime \"invalid\" 转换为 timestamp."
 
-#: utils/adt/nabstime.c:855
-#, c-format
-msgid "cannot convert reltime \"invalid\" to interval"
-msgstr "无法把 reltime \"invalid\" 转换为 interval"
-
 #: utils/adt/network.c:69
 #, c-format
 msgid "invalid cidr value: \"%s\""
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index c6fa81e..c048010 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -2,7 +2,6 @@
  *
  * nabstime.c
  *	  Utilities for the built-in type "AbsoluteTime".
- *	  Functions for the built-in type "RelativeTime".
  *
  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
@@ -37,8 +36,6 @@
  * for these 4-byte types.
  */
 
-#define IsSpace(C)				((C) == ' ')
-
 #define ABSTIMEMIN(t1, t2) \
 	(DatumGetBool(DirectFunctionCall2(abstimele, \
 				  AbsoluteTimeGetDatum(t1), \
@@ -54,7 +51,6 @@
  */
 
 static AbsoluteTime tm2abstime(struct pg_tm *tm, int tz);
-static void reltime2tm(RelativeTime time, struct pg_tm *tm);
 
 /*
  * GetCurrentAbsoluteTime()
@@ -554,239 +550,10 @@ abstime_timestamptz(PG_FUNCTION_ARGS)
 	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_sendint(&buf, time, sizeof(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);
-}
-
-
 /*****************************************************************************
  *	 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);
-}
-
-
-/*
- *		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);
-}
-
 
 /*
  *		timenow			- returns  time "now", internal format
@@ -799,99 +566,6 @@ 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));
-}
-
 /*****************************************************************************
  *
  *****************************************************************************/
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index b28f428..ec53a9a 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -3945,7 +3945,6 @@ convert_to_scalar(Datum value, Oid valuetypid, double *scaledvalue,
 		case ABSTIMEOID:
 		case DATEOID:
 		case INTERVALOID:
-		case RELTIMEOID:
 		case TIMEOID:
 		case TIMETZOID:
 			*scaledvalue = convert_timevalue_to_scalar(value, valuetypid);
@@ -4376,8 +4375,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 TIMEOID:
 			return DatumGetTimeADT(value);
 		case TIMETZOID:
diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h
index 6fc2f08..74a3706 100644
--- a/src/include/catalog/pg_amop.h
+++ b/src/include/catalog/pg_amop.h
@@ -463,16 +463,6 @@ 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 array_ops
  */
 
@@ -581,8 +571,6 @@ DATA(insert (	2225   28 28 1 s	352 405 0 ));
 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 */
@@ -989,12 +977,6 @@ 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 cca4d63..35558aa 100644
--- a/src/include/catalog/pg_amproc.h
+++ b/src/include/catalog/pg_amproc.h
@@ -135,7 +135,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 (	2789   27 27 1 2794 ));
 DATA(insert (	2968   2950 2950 1 2960 ));
 DATA(insert (	2968   2950 2950 2 3300 ));
@@ -177,7 +176,6 @@ DATA(insert (	2223   17 17 1 456 ));
 DATA(insert (	2225   28 28 1 450 ));
 DATA(insert (	2226   29 29 1 450 ));
 DATA(insert (	2227   702 702 1 450 ));
-DATA(insert (	2228   703 703 1 450 ));
 DATA(insert (	2229   25 25 1 400 ));
 DATA(insert (	2231   1042 1042 1 1080 ));
 DATA(insert (	2235   1033 1033 1 329 ));
@@ -406,11 +404,6 @@ 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 1782753..0a3b3af 100644
--- a/src/include/catalog/pg_cast.h
+++ b/src/include/catalog/pg_cast.h
@@ -269,7 +269,6 @@ 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 ));
@@ -283,14 +282,11 @@ 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 */
+/* Cross-category casts between int4 and abstime */
 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 8212304..504ddf2 100644
--- a/src/include/catalog/pg_opclass.h
+++ b/src/include/catalog/pg_opclass.h
@@ -174,11 +174,9 @@ 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 (	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,7 +221,6 @@ 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 d79f5f2..8157ef3 100644
--- a/src/include/catalog/pg_operator.h
+++ b/src/include/catalog/pg_operator.h
@@ -361,22 +361,6 @@ DATA(insert OID = 564 (  "<="	   PGNSP PGUID b f f 702 702	16 565 563 abstimele
 DESCR("less than or equal");
 DATA(insert OID = 565 (  ">="	   PGNSP PGUID b f f 702 702	16 564 562 abstimege scalargtsel scalargtjoinsel ));
 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 scalarltsel scalarltjoinsel ));
-DESCR("less than or equal");
-DATA(insert OID = 571 (  ">="	   PGNSP PGUID b f f 703 703	16 570 568 reltimege scalargtsel scalargtjoinsel ));
-DESCR("greater than or equal");
-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 = 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 - - ));
diff --git a/src/include/catalog/pg_opfamily.h b/src/include/catalog/pg_opfamily.h
index b13590a..d0ab051 100644
--- a/src/include/catalog/pg_opfamily.h
+++ b/src/include/catalog/pg_opfamily.h
@@ -123,10 +123,8 @@ 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 = 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,7 +168,6 @@ 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 c002766..5e902e7 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -444,12 +444,6 @@ DATA(insert OID = 240 (  abstimein		   PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1
 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 = 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_ ));
@@ -458,12 +452,6 @@ DATA(insert OID = 253 (  abstimelt		   PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2
 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 = 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_ ));
@@ -613,8 +601,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 = 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");
 
@@ -1227,8 +1213,6 @@ 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_ ));
@@ -1243,8 +1227,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_ ));
@@ -1493,8 +1475,6 @@ 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_ ));
@@ -4006,10 +3986,6 @@ DATA(insert OID = 2462 (  abstimerecv		   PGNSP PGUID 12 1 0 0 0 f f f f t f i s
 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 = 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 aab23cb..d54b453 100644
--- a/src/include/catalog/pg_type.h
+++ b/src/include/catalog/pg_type.h
@@ -420,9 +420,6 @@ DESCR("double-precision floating point number, 8-byte storage");
 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 = 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("");
 #define UNKNOWNOID		705
@@ -482,7 +479,6 @@ DATA(insert OID = 1021 (  _float4	 PGNSP PGUID -1 f b A f t \054 0 700 0 array_i
 #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 = 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 7968569..c426677 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 abstime, 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
index 3f54ff4..4bd4c2b 100644
--- a/src/include/utils/nabstime.h
+++ b/src/include/utils/nabstime.h
@@ -34,22 +34,14 @@
  * interval.
  */
 typedef int32 AbsoluteTime;
-typedef int32 RelativeTime;
 
 /*
  * Macros for fmgr-callable functions.
  */
 #define DatumGetAbsoluteTime(X)  ((AbsoluteTime) DatumGetInt32(X))
-#define DatumGetRelativeTime(X)  ((RelativeTime) DatumGetInt32(X))
-
 #define AbsoluteTimeGetDatum(X)  Int32GetDatum(X)
-#define RelativeTimeGetDatum(X)  Int32GetDatum(X)
-
 #define PG_GETARG_ABSOLUTETIME(n)  DatumGetAbsoluteTime(PG_GETARG_DATUM(n))
-#define PG_GETARG_RELATIVETIME(n)  DatumGetRelativeTime(PG_GETARG_DATUM(n))
-
 #define PG_RETURN_ABSOLUTETIME(x)  return AbsoluteTimeGetDatum(x)
-#define PG_RETURN_RELATIVETIME(x)  return RelativeTimeGetDatum(x)
 
 /*
  * Reserved values
@@ -65,8 +57,6 @@ typedef int32 RelativeTime;
 #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))
 
@@ -80,10 +70,6 @@ typedef int32 RelativeTime;
 	((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);
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 7e24687..cb81322 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -225,8 +225,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), 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), 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 e6d4843..24d71c6 100644
--- a/src/interfaces/ecpg/ecpglib/pg_type.h
+++ b/src/interfaces/ecpg/ecpglib/pg_type.h
@@ -39,7 +39,6 @@
 #define FLOAT4OID 700
 #define FLOAT8OID 701
 #define ABSTIMEOID		702
-#define RELTIMEOID		703
 #define UNKNOWNOID		705
 #define CIRCLEOID		718
 #define CASHOID 790
diff --git a/src/test/regress/expected/abstime.out b/src/test/regress/expected/abstime.out
index 91614da..26899c0 100644
--- a/src/test/regress/expected/abstime.out
+++ b/src/test/regress/expected/abstime.out
@@ -1,7 +1,6 @@
 --
 -- ABSTIME
 -- testing built-in time type abstime
--- uses reltime
 --
 --
 -- timezones may vary based not only on location but the operating
diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out
index f9d12e0..16eafe3 100644
--- a/src/test/regress/expected/horology.out
+++ b/src/test/regress/expected/horology.out
@@ -2047,70 +2047,6 @@ SELECT '' AS "226", d1.f1 AS timestamp1, d2.f1 AS timestamp2, d1.f1 - d2.f1 AS d
 (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
 --
 SELECT '' AS "16", f1 AS "timestamp", date(f1) AS date
@@ -2183,34 +2119,6 @@ SELECT '' AS two, d1 AS "timestamp", abstime(d1) AS abstime
 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
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 56a4b26..d5a738b 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -526,12 +526,6 @@ 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)
 float4eq(real,real)
 float4ne(real,real)
 float4lt(real,real)
diff --git a/src/test/regress/expected/reltime.out b/src/test/regress/expected/reltime.out
deleted file mode 100644
index 14fdc6a..0000000
--- 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/sanity_check.out b/src/test/regress/expected/sanity_check.out
index 7840c4c..6cc8104 100644
--- a/src/test/regress/expected/sanity_check.out
+++ b/src/test/regress/expected/sanity_check.out
@@ -165,7 +165,6 @@ quad_point_tbl|t
 radix_text_tbl|t
 ramp|f
 real_city|f
-reltime_tbl|f
 road|t
 shighway|t
 slow_emp4000|f
diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule
index c5f9ffe..ff7d875 100644
--- a/src/test/regress/parallel_schedule
+++ b/src/test/regress/parallel_schedule
@@ -23,12 +23,12 @@ test: numerology
 # ----------
 # The second group of parallel tests
 # ----------
-test: point lseg line box path polygon circle date time timetz timestamp timestamptz interval abstime reltime inet macaddr macaddr8 tstypes
+test: point lseg line box path polygon circle date time timetz timestamp timestamptz interval abstime inet macaddr macaddr8 tstypes
 
 # ----------
 # Another group of parallel tests
 # geometry depends on point, lseg, box, path, polygon and circle
-# horology depends on interval, timetz, timestamp, timestamptz, reltime and abstime
+# horology depends on interval, timetz, timestamp, timestamptz, and abstime
 # ----------
 test: geometry horology regex oidjoins type_sanity opr_sanity misc_sanity comments expressions
 
diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule
index 83ba380..1cf10e9 100644
--- a/src/test/regress/serial_schedule
+++ b/src/test/regress/serial_schedule
@@ -37,7 +37,6 @@ test: timestamp
 test: timestamptz
 test: interval
 test: abstime
-test: reltime
 test: inet
 test: macaddr
 test: macaddr8
diff --git a/src/test/regress/sql/abstime.sql b/src/test/regress/sql/abstime.sql
index 650d7fd..bcb4cd8 100644
--- a/src/test/regress/sql/abstime.sql
+++ b/src/test/regress/sql/abstime.sql
@@ -1,7 +1,6 @@
 --
 -- ABSTIME
 -- testing built-in time type abstime
--- uses reltime
 --
 
 --
diff --git a/src/test/regress/sql/horology.sql b/src/test/regress/sql/horology.sql
index a7bc9dc..1cf02d3 100644
--- a/src/test/regress/sql/horology.sql
+++ b/src/test/regress/sql/horology.sql
@@ -268,35 +268,6 @@ SELECT '' AS "226", d1.f1 AS timestamp1, d2.f1 AS timestamp2, d1.f1 - d2.f1 AS d
   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
 --
 
@@ -320,12 +291,6 @@ SELECT '' AS two, d1 AS "timestamp", abstime(d1) AS abstime
 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;
 
 --
diff --git a/src/test/regress/sql/reltime.sql b/src/test/regress/sql/reltime.sql
deleted file mode 100644
index a07b64e..0000000
--- 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/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index cd26dc2..1163ee5 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -1830,7 +1830,6 @@ Relation
 RelationData
 RelationPtr
 RelationSyncEntry
-RelativeTime
 RelcacheCallbackFunction
 RelfilenodeMapEntry
 RelfilenodeMapKey
#19Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mark Dilger (#18)
Re: Something for the TODO list: deprecating abstime and friends

Mark Dilger <hornschnorter@gmail.com> writes:

On Jul 18, 2017, at 9:13 PM, Mark Dilger <hornschnorter@gmail.com> wrote:
There was not much conversation about this, so I went ahead with what
I think makes a logical first step. The attached patch removes the tinterval
datatype from the sources.

As predicted, this second patch (which should be applied *after* the prior
tinterval_abatement patch) removes the reltime datatype from the sources.

Seems like a good plan. Please be sure to add these patches to the next
commitfest, so we remember them when the time comes.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#20Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#12)
Re: Something for the TODO list: deprecating abstime and friends

On Mon, Jul 17, 2017 at 6:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

So, thinking about how that would actually work ... the thing to do in
order to preserve existing on-disk values is to alternate between signed
and unsigned interpretations of abstimes. That is, right now, abstime
is signed with origin 1970. The conversion I'm arguing we should make
real soon now is to unsigned with origin 1970. If the project lives
so long, in circa 70 years we'd switch it to signed with origin 2106.
Yadda yadda.

Doesn't this plan amount to breaking pg_upgrade compatibility and
hoping that nobody notice? Existing values will be silently
reinterpreted according to the new rules. If we had two actually
separate types and let people convert columns from the old type to the
new type with just a validation scan, that would be engineering at the
level of quality that I've come to associate with this project. If
this type is so marginal that we don't want to do that kind of work,
then I think we should just rip it out; that doesn't preclude someone
maintaining it in their own fork, or even adding it back as a new type
in a contrib module with a #define for the base year. Silently
changing the interpretation of the same data in the core code, though,
seems both far too clever and not clever enough.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#21Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#20)
Re: Something for the TODO list: deprecating abstime and friends

Robert Haas <robertmhaas@gmail.com> writes:

On Mon, Jul 17, 2017 at 6:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

So, thinking about how that would actually work ... the thing to do in
order to preserve existing on-disk values is to alternate between signed
and unsigned interpretations of abstimes. That is, right now, abstime
is signed with origin 1970. The conversion I'm arguing we should make
real soon now is to unsigned with origin 1970. If the project lives
so long, in circa 70 years we'd switch it to signed with origin 2106.
Yadda yadda.

Doesn't this plan amount to breaking pg_upgrade compatibility and
hoping that nobody notice?

Well, what we'd need to do is document that the type is only meant to be
used to store dates within say +/- 30 years from current time. As long
as people adhere to that use-case, the proposal would work conveniently
long into the future ...

If we had two actually
separate types and let people convert columns from the old type to the
new type with just a validation scan, that would be engineering at the
level of quality that I've come to associate with this project.

... whereas that would be seriously INconvenient. It's not just the
ALTER TABLE pushups, which presumably would be something you could do
and forget. It's that the new type name would be something you'd have
to change your applications to know about, and then you (or more likely
your successor) would have to do it over again decades later.

I'd definitely be on board with just dropping the type altogether despite
Mark's concern. But I am not sure that the way you are proposing would
please anybody except pedants.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#22David Fetter
david@fetter.org
In reply to: Tom Lane (#21)
Re: Something for the TODO list: deprecating abstime and friends

On Wed, Jul 19, 2017 at 01:12:02PM -0400, Tom Lane wrote:

Robert Haas <robertmhaas@gmail.com> writes:

On Mon, Jul 17, 2017 at 6:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

So, thinking about how that would actually work ... the thing to do in
order to preserve existing on-disk values is to alternate between signed
and unsigned interpretations of abstimes. That is, right now, abstime
is signed with origin 1970. The conversion I'm arguing we should make
real soon now is to unsigned with origin 1970. If the project lives
so long, in circa 70 years we'd switch it to signed with origin 2106.
Yadda yadda.

Doesn't this plan amount to breaking pg_upgrade compatibility and
hoping that nobody notice?

Well, what we'd need to do is document that the type is only meant to be
used to store dates within say +/- 30 years from current time. As long
as people adhere to that use-case, the proposal would work conveniently
long into the future ...

If we had two actually
separate types and let people convert columns from the old type to the
new type with just a validation scan, that would be engineering at the
level of quality that I've come to associate with this project.

... whereas that would be seriously INconvenient. It's not just the
ALTER TABLE pushups, which presumably would be something you could do
and forget. It's that the new type name would be something you'd have
to change your applications to know about, and then you (or more likely
your successor) would have to do it over again decades later.

I'd definitely be on board with just dropping the type altogether despite
Mark's concern. But I am not sure that the way you are proposing would
please anybody except pedants.

+1 for just dropping the types, preferably modifying the contrib
extensions that depend on it, less preferably, dropping those, too.

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#23Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#21)
Re: Something for the TODO list: deprecating abstime and friends

On Wed, Jul 19, 2017 at 1:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Doesn't this plan amount to breaking pg_upgrade compatibility and
hoping that nobody notice?

Well, what we'd need to do is document that the type is only meant to be
used to store dates within say +/- 30 years from current time. As long
as people adhere to that use-case, the proposal would work conveniently
long into the future ...

Typically, when you try to store an out-of-range value in PostgreSQL,
you get an ERROR, and that's one of the selling points of PostgreSQL.
PostgreSQL users regularly beat up other projects for, say, allowing
0000-00-00 to be considered a valid date, or any similar perceived
laxity in enforcing data consistency. I don't like the idea that we
can just deviate from that principle whenever adhering to it is too
much work.

I'd definitely be on board with just dropping the type altogether despite
Mark's concern.

Then I vote for that option.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#24Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#23)
Re: Something for the TODO list: deprecating abstime and friends

Robert Haas <robertmhaas@gmail.com> writes:

On Wed, Jul 19, 2017 at 1:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I'd definitely be on board with just dropping the type altogether despite
Mark's concern.

Then I vote for that option.

BTW, another possible compromise is to move abstime into a contrib
module; we've always accepted that contrib modules can be held to a
lower standard than core features. I'm not volunteering to do the
work for that, but it's worth contemplating.

Alternatively, we could turn the origin point for abstime into a
pg_control field, and regard changing it as a reason for a database
not being pg_upgrade'able unless it lacks any abstime columns.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#25Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#24)
Re: Something for the TODO list: deprecating abstime and friends

On Wed, Jul 19, 2017 at 1:35 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Robert Haas <robertmhaas@gmail.com> writes:

On Wed, Jul 19, 2017 at 1:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I'd definitely be on board with just dropping the type altogether despite
Mark's concern.

Then I vote for that option.

BTW, another possible compromise is to move abstime into a contrib
module; we've always accepted that contrib modules can be held to a
lower standard than core features. I'm not volunteering to do the
work for that, but it's worth contemplating.

I would be OK with that, provided the documentation calls out the hazard.

Alternatively, we could turn the origin point for abstime into
pg_control field, and regard changing it as a reason for a database
not being pg_upgrade'able unless it lacks any abstime columns.

I would be OK with that, too, but is there any danger that we're going
to grow pg_control to a size where reads and writes can no longer be
assumed atomic, if we keep adding things?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#26Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#25)
Re: Something for the TODO list: deprecating abstime and friends

Robert Haas <robertmhaas@gmail.com> writes:

On Wed, Jul 19, 2017 at 1:35 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Alternatively, we could turn the origin point for abstime into
pg_control field, and regard changing it as a reason for a database
not being pg_upgrade'able unless it lacks any abstime columns.

I would be OK with that, too, but is there any danger that we're going
to grow pg_control to a size where reads and writes can no longer be
assumed atomic, if we keep adding things?

Hm. Currently sizeof(struct ControlFileData) = 296, at least on my
machine. Letting it grow past 512 would be problematic. It's hard
to see getting to that any time soon, though; we don't add fields
there often.

Note that I'm not seriously pushing for this solution. I'm just trying
to make sure that we've considered all the reasonable options.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#27Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#26)
Re: Something for the TODO list: deprecating abstime and friends

I wrote:

Hm. Currently sizeof(struct ControlFileData) = 296, at least on my
machine. Letting it grow past 512 would be problematic. It's hard
to see getting to that any time soon, though; we don't add fields
there often.

I wonder if it'd be worth the trouble to stick something like this into
xlog.c:

/*
* For reliability's sake, it's critical that pg_control updates
* be atomic writes. That generally means the active data can't
* be more than one disk sector, which is 512 bytes on common
* hardware. Be very careful about raising this limit.
*/
StaticAssertStmt(sizeof(ControlFileData) <= 512,
"pg_control is too large for atomic disk writes");

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#28Michael Paquier
michael.paquier@gmail.com
In reply to: Tom Lane (#27)
Re: Something for the TODO list: deprecating abstime and friends

On Wed, Jul 19, 2017 at 8:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I wonder if it'd be worth the trouble to stick something like this into
xlog.c:

/*
* For reliability's sake, it's critical that pg_control updates
* be atomic writes. That generally means the active data can't
* be more than one disk sector, which is 512 bytes on common
* hardware. Be very careful about raising this limit.
*/
StaticAssertStmt(sizeof(ControlFileData) <= 512,
"pg_control is too large for atomic disk writes");

+1. Even if it just gets triggered in 20 years by some hacker, that's
a good reminder about assumptions behind the update logic.
-- 
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#29Mark Dilger
hornschnorter@gmail.com
In reply to: Robert Haas (#23)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 19, 2017, at 10:23 AM, Robert Haas <robertmhaas@gmail.com> wrote:

On Wed, Jul 19, 2017 at 1:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Doesn't this plan amount to breaking pg_upgrade compatibility and
hoping that nobody notice?

Well, what we'd need to do is document that the type is only meant to be
used to store dates within say +/- 30 years from current time. As long
as people adhere to that use-case, the proposal would work conveniently
long into the future ...

Typically, when you try to store an out-of-range value in PostgreSQL,
you get an ERROR, and that's one of the selling points of PostgreSQL.
PostgreSQL users regularly beat up other projects for, say, allowing
0000-00-00 to be considered a valid date, or any similar perceived
laxity in enforcing data consistency. I don't like the idea that we
can just deviate from that principle whenever adhering to it is too
much work.

I don't see the relevance of this statement. I am not planning to allow
abstime data that is outside the range of the new epoch. Attempts to
cast strings like '1962-07-07 01:02:03' to abstime would draw an
exception with a suitably informative message.

Now, the objection to having on-disk data automagically change meaning
is concerning, and I was particularly unsatisfied with the idea that
NOSTART_ABSTIME and NOEND_ABSTIME would suddenly be
reinterpreted as seconds in the year 2068, which is why I made mention
of it upthread. I was less concerned with dates prior to 1970 being
reinterpreted, though it is hard to justify why that bothers me less.

I'd definitely be on board with just dropping the type altogether despite
Mark's concern.

Then I vote for that option.

I was somewhat surprised when Tom was onboard with the idea of keeping
abstime around (for my benefit). My original post was in response to his
statement that, right offhand, he couldn't think of any use for abstime that
wasn't handled better by timestamptz (paraphrase), and so I said that
improving storage efficiency was such a use. I maintain that position. The
abstime type is a good and useful type, and we will lose that use when we
discard it. Those who feel otherwise might like to also argue for dropping
float4 because float8 does all the same stuff better.

mark

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#30Mark Dilger
hornschnorter@gmail.com
In reply to: Robert Haas (#20)
Re: Something for the TODO list: deprecating abstime and friends

On Jul 19, 2017, at 9:53 AM, Robert Haas <robertmhaas@gmail.com> wrote:

On Mon, Jul 17, 2017 at 6:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

So, thinking about how that would actually work ... the thing to do in
order to preserve existing on-disk values is to alternate between signed
and unsigned interpretations of abstimes. That is, right now, abstime
is signed with origin 1970. The conversion I'm arguing we should make
real soon now is to unsigned with origin 1970. If the project lives
so long, in circa 70 years we'd switch it to signed with origin 2106.
Yadda yadda.

Doesn't this plan amount to breaking pg_upgrade compatibility and
hoping that nobody notice? Existing values will be silently
reinterpreted according to the new rules. If we had two actually
separate types and let people convert columns from the old type to the
new type with just a validation scan, that would be engineering at the
level of quality that I've come to associate with this project.

This is what I have done in my fork. I repurposed the type as "secondstamp"
since I think of it as a timestamp down to second precision (truncating
fractional seconds.) I changed the Oids assigned to the catalog entries
associated with the type, and considered myself somewhat immune to
the project dropping the abstime type, which the documentation warned
would happen eventually.

If
this type is so marginal that we don't want to do that kind of work,
then I think we should just rip it out; that doesn't preclude someone
maintaining it in their own fork, or even adding it back as a new type
in a contrib module with a #define for the base year. Silently
changing the interpretation of the same data in the core code, though,
seems both far too clever and not clever enough.

I would be happy to contribute the "secondstamp" type as part of a patch
that removes the abstime type. I can add a catalog table that holds the
epoch, and add documentation for the type stating that every time the
epoch changes, their data will be automatically reinterpreted, and as such
they should only use the datatype if that is ok.

Under this plan, users with abstime columns who upgrade to postgres 11
will not have an easy time, because the type will be removed. But that is
the same and no worse than what they would get if we just remove the
abstime type in postgres 11 without any replacement.

I'm not implementing any of this yet, as I expect further objections.

Thoughts?

mark

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#31Robert Haas
robertmhaas@gmail.com
In reply to: Mark Dilger (#29)
Re: Something for the TODO list: deprecating abstime and friends

On Wed, Jul 19, 2017 at 3:26 PM, Mark Dilger <hornschnorter@gmail.com> wrote:

Typically, when you try to store an out-of-range value in PostgreSQL,
you get an ERROR, and that's one of the selling points of PostgreSQL.
PostgreSQL users regularly beat up other projects for, say, allowing
0000-00-00 to be considered a valid date, or any similar perceived
laxity in enforcing data consistency. I don't like the idea that we
can just deviate from that principle whenever adhering to it is too
much work.

I don't see the relevance of this statement. I am not planning to allow
abstime data that is outside the range of the new epoch. Attempts to
cast strings like '1962-07-07 01:02:03' to abstime would draw an
exception with a suitably informative message.

Now, the objection to having on-disk data automagically change meaning
is concerning, ...

I see those things as very similar issues, but YMMV.

... and I was particularly unsatisfied with the idea that
NOSTART_ABSTIME and NOEND_ABSTIME would suddenly be
reinterpreted as seconds in the year 2068, which is why I made mention
of it upthread. I was less concerned with dates prior to 1970 being
reinterpreted, though it is hard to justify why that bothers me less.

I think any change in the meaning of bytes already on disk is a
concern. It wouldn't bother me to say "these are second-class types,
so if you have columns of this type, pg_upgrade will fail and tell you
that you can't upgrade a database with those columns from a catversion
< X to a catversion > X". But having it silently work and silently
corrupt your data doesn't seem OK to me.

Those who feel otherwise might like to also argue for dropping
float4 because float8 does all the same stuff better.

I don't think that's the same thing, but given my notorious hatred of
floating point arithmetic, it would also bother me less than you might
think.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#32Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Paquier (#28)
Re: Something for the TODO list: deprecating abstime and friends

Michael Paquier <michael.paquier@gmail.com> writes:

On Wed, Jul 19, 2017 at 8:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I wonder if it'd be worth the trouble to stick something like this into
xlog.c:
StaticAssertStmt(sizeof(ControlFileData) <= 512,
"pg_control is too large for atomic disk writes");

+1. Even if it just gets triggered in 20 years by some hacker, that's
a good reminder about assumptions behind the update logic.

Done. I found the size checks had metastasized into pg_resetwal as well,
and probably should have been in pg_rewind since it also rewrites
pg_control, so it ended up a slightly larger patch than I first thought.
Seems cleaner than before though.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#33Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#1)
1 attachment(s)
Re: [HACKERS] Something for the TODO list: deprecating abstime and friends

Hi,

On 2017-07-15 18:00:34 -0400, Tom Lane wrote:

The types abstime, reltime, and tinterval need to go away, or be
reimplemented, sometime well before 2038 when they will overflow.
It's not too soon to start having a plan for that, especially seeing
that it seems to take a decade or more for us to actually get rid
of anything we've deprecated.

Right offhand, I don't think there is any functionality in these
types that isn't handled as well or better by timestamptz, interval,
and tstzrange respectively. And they're basically undocumented
except for a sort-of deprecation notice just above section 8.5.1.
So my inclination is to remove them rather than try to upgrade them
in any way.

Hah, I'd completely missed this thread. But very recently arrived at the
the same conclusion, albeit for different reasons. Largely because the
code isn't very rigid about dealing with overflows. I really don't want
to invest time in polishing up code that, as you say, doesn't really
have much of a usecase.

However, we'd have to do something about:

* The legacy system views pg_shadow and pg_user have abstime columns.
Experimentation suggests that we could convert those to timestamptz(0)
and the output format wouldn't change, so maybe that's a good enough
fix there.

Yea, I think that's reasonable. I think it'd also be defensible to go to
a pure timestamptz rather than timestamptz(0). That's going to
negatively effect very few users...

* contrib/spi/timetravel depends on abstime columns to represent what
would nowadays be better done as a tstzrange. I'd have thought we
could maybe toss that example module overboard, but we just today got
a question about its usage, so I'm afraid it's not quite dead yet.
What shall we do with that?

Looking at the code I'd be pretty strongly inclined to scrap it.

Before I'd discovered this thread, I'd started to write up a
patch. Attached. It's clearly not fully done. Questions I'd while
hacking things up:
- what to do with contrib/spi/timetravel - I'd just removed it from the
relevant Makefile for now.
- nabstime.c currently implements timeofday() which imo is a pretty
weird function. I'd be quite inclined to remove it at the same time as
this.

Greetings,

Andres Freund

Attachments:

0001-Remove-out-of-date-types.patchtext/x-diff; charset=us-asciiDownload
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

#34Andres Freund
andres@anarazel.de
In reply to: Mark Dilger (#8)
Re: [HACKERS] Something for the TODO list: deprecating abstime and friends

Hi,

On 2017-07-17 12:54:31 -0700, Mark Dilger wrote:

These types provide a 4-byte datatype for storing real-world second
precision timestamps, as occur in many log files.

These seem to be getting less common IME, most products have higher
resolution these days. If this were nicely written, maintainable, and
documented code my position would differ, but it really isn't.

That said, I am fully aware that these are deprecated and expect you
will remove them, at which time I'll have to keep them in my tree
and politely refuse to merge in your change which removes them.

It'd be way less work to package abstime as an extension if you want to
do so.

Greetings,

Andres Freund

#35Mark Dilger
hornschnorter@gmail.com
In reply to: Andres Freund (#34)
Re: [HACKERS] Something for the TODO list: deprecating abstime and friends

On Dec 13, 2017, at 12:07 AM, Andres Freund <andres@anarazel.de> wrote:

Hi,

On 2017-07-17 12:54:31 -0700, Mark Dilger wrote:

These types provide a 4-byte datatype for storing real-world second
precision timestamps, as occur in many log files.

These seem to be getting less common IME, most products have higher
resolution these days. If this were nicely written, maintainable, and
documented code my position would differ, but it really isn't.

That said, I am fully aware that these are deprecated and expect you
will remove them, at which time I'll have to keep them in my tree
and politely refuse to merge in your change which removes them.

It'd be way less work to package abstime as an extension if you want to
do so.

After proposing to submit a patch for the secondstamp datatype (which
I mentioned upthread), Robert objected to the idea of data on disk changing
meaning, which was a part of the idea that Tom seemed to be willing to
accept. Since I couldn't get both Tom and Robert on board with any
particular design, I silently withdrew from the development of any such
patch.

This has happened on several proposals I have made on this list over
the years. Unless there is fairly unanimous support from the committers,
I don't bother following through with a proposal, given the improbability
of it getting accepted.

I would happily finish and submit that prior proposal if there were general
agreement that it is a good design. I have no interest in making abstime
into an extension, however.

mark

#36David Fetter
david@fetter.org
In reply to: Andres Freund (#33)
Re: [HACKERS] Something for the TODO list: deprecating abstime and friends

On Wed, Dec 13, 2017 at 12:05:06AM -0800, Andres Freund wrote:

On 2017-07-15 18:00:34 -0400, Tom Lane wrote:

* contrib/spi/timetravel depends on abstime columns to represent what
would nowadays be better done as a tstzrange. I'd have thought we
could maybe toss that example module overboard, but we just today got
a question about its usage, so I'm afraid it's not quite dead yet.
What shall we do with that?

Looking at the code I'd be pretty strongly inclined to scrap it.

Before I'd discovered this thread, I'd started to write up a
patch. Attached. It's clearly not fully done. Questions I'd while
hacking things up:
- what to do with contrib/spi/timetravel - I'd just removed it from the
relevant Makefile for now.

Porting it to tstzrange seems friendlier, however:

- Does that look like significant work to do this port?
- How about the work involved with upgrading existing installations?

- nabstime.c currently implements timeofday() which imo is a pretty
weird function. I'd be quite inclined to remove it at the same time as
this.

+1 for binning it.

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#37Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#33)
2 attachment(s)
Re: [HACKERS] Something for the TODO list: deprecating abstime and friends

Hi,

On 2017-12-13 00:05:06 -0800, Andres Freund wrote:

* contrib/spi/timetravel depends on abstime columns to represent what
would nowadays be better done as a tstzrange. I'd have thought we
could maybe toss that example module overboard, but we just today got
a question about its usage, so I'm afraid it's not quite dead yet.
What shall we do with that?

Looking at the code I'd be pretty strongly inclined to scrap it.

Before I'd discovered this thread, I'd started to write up a
patch. Attached. It's clearly not fully done. Questions I'd while
hacking things up:
- what to do with contrib/spi/timetravel - I'd just removed it from the
relevant Makefile for now.
- nabstime.c currently implements timeofday() which imo is a pretty
weird function. I'd be quite inclined to remove it at the same time as
this.

Here's a refreshed version of this patch. First patch removes
contrib/spi/timetravel, second patch removes abstime, reltime, tinterval
together with timeofday().

I think we should just go ahead and commit something like this soon.

- Andres

Attachments:

v1-0001-Remove-timetravel-extension.patchtext/x-diff; charset=iso-8859-1Download
From 0ef06b0c50c882f418ca9d71fe53e0570738b3a6 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Fri, 28 Sep 2018 15:13:42 -0700
Subject: [PATCH v1 1/2] Remove timetravel extension.

The extension depended on old types which are about to be removed. As
the code additionally was pretty crufty and didn't provide that much
in the way of features, removing the extension seems to be the best
way forward.

Author: Andres Freund
Discussion:
    https://postgr.es/m/20171213080506.cwjkpcz3bkk6yz2u@alap3.anarazel.de
    https://postgr.es/m/25615.1513115237@sss.pgh.pa.us
---
 contrib/spi/Makefile                        |   7 +-
 contrib/spi/timetravel--1.0.sql             |  19 -
 contrib/spi/timetravel--unpackaged--1.0.sql |   8 -
 contrib/spi/timetravel.c                    | 553 --------------------
 contrib/spi/timetravel.control              |   5 -
 contrib/spi/timetravel.example              |  81 ---
 doc/src/sgml/contrib-spi.sgml               |  93 ----
 src/tools/msvc/Install.pm                   |   2 +-
 8 files changed, 4 insertions(+), 764 deletions(-)
 delete mode 100644 contrib/spi/timetravel--1.0.sql
 delete mode 100644 contrib/spi/timetravel--unpackaged--1.0.sql
 delete mode 100644 contrib/spi/timetravel.c
 delete mode 100644 contrib/spi/timetravel.control
 delete mode 100644 contrib/spi/timetravel.example

diff --git a/contrib/spi/Makefile b/contrib/spi/Makefile
index 42aa3740c42..6bc2318e0ac 100644
--- a/contrib/spi/Makefile
+++ b/contrib/spi/Makefile
@@ -1,14 +1,13 @@
 # contrib/spi/Makefile
 
-MODULES = autoinc insert_username moddatetime refint timetravel
+MODULES = autoinc insert_username moddatetime refint
 
-EXTENSION = autoinc insert_username moddatetime refint timetravel
+EXTENSION = autoinc insert_username moddatetime refint
 
 DATA = autoinc--1.0.sql autoinc--unpackaged--1.0.sql \
        insert_username--1.0.sql insert_username--unpackaged--1.0.sql \
        moddatetime--1.0.sql moddatetime--unpackaged--1.0.sql \
-       refint--1.0.sql refint--unpackaged--1.0.sql \
-       timetravel--1.0.sql timetravel--unpackaged--1.0.sql
+       refint--1.0.sql refint--unpackaged--1.0.sql
 PGFILEDESC = "spi - examples of using SPI and triggers"
 
 DOCS = $(addsuffix .example, $(MODULES))
diff --git a/contrib/spi/timetravel--1.0.sql b/contrib/spi/timetravel--1.0.sql
deleted file mode 100644
index c34ca09965b..00000000000
--- a/contrib/spi/timetravel--1.0.sql
+++ /dev/null
@@ -1,19 +0,0 @@
-/* contrib/spi/timetravel--1.0.sql */
-
--- complain if script is sourced in psql, rather than via CREATE EXTENSION
-\echo Use "CREATE EXTENSION timetravel" to load this file. \quit
-
-CREATE FUNCTION timetravel()
-RETURNS trigger
-AS 'MODULE_PATHNAME'
-LANGUAGE C;
-
-CREATE FUNCTION set_timetravel(name, int4)
-RETURNS int4
-AS 'MODULE_PATHNAME'
-LANGUAGE C RETURNS NULL ON NULL INPUT;
-
-CREATE FUNCTION get_timetravel(name)
-RETURNS int4
-AS 'MODULE_PATHNAME'
-LANGUAGE C RETURNS NULL ON NULL INPUT;
diff --git a/contrib/spi/timetravel--unpackaged--1.0.sql b/contrib/spi/timetravel--unpackaged--1.0.sql
deleted file mode 100644
index 121bceba9b2..00000000000
--- a/contrib/spi/timetravel--unpackaged--1.0.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-/* contrib/spi/timetravel--unpackaged--1.0.sql */
-
--- complain if script is sourced in psql, rather than via CREATE EXTENSION
-\echo Use "CREATE EXTENSION timetravel FROM unpackaged" to load this file. \quit
-
-ALTER EXTENSION timetravel ADD function timetravel();
-ALTER EXTENSION timetravel ADD function set_timetravel(name,integer);
-ALTER EXTENSION timetravel ADD function get_timetravel(name);
diff --git a/contrib/spi/timetravel.c b/contrib/spi/timetravel.c
deleted file mode 100644
index 00f661e6b69..00000000000
--- a/contrib/spi/timetravel.c
+++ /dev/null
@@ -1,553 +0,0 @@
-/*
- * contrib/spi/timetravel.c
- *
- *
- * timetravel.c --	function to get time travel feature
- *		using general triggers.
- *
- * Modified by BÖJTHE Zoltán, Hungary, mailto:urdesobt@axelero.hu
- */
-#include "postgres.h"
-
-#include <ctype.h>
-
-#include "access/htup_details.h"
-#include "catalog/pg_type.h"
-#include "commands/trigger.h"
-#include "executor/spi.h"
-#include "miscadmin.h"
-#include "utils/builtins.h"
-#include "utils/nabstime.h"
-#include "utils/rel.h"
-
-PG_MODULE_MAGIC;
-
-/* AbsoluteTime currabstime(void); */
-
-typedef struct
-{
-	char	   *ident;
-	SPIPlanPtr	splan;
-} EPlan;
-
-static EPlan *Plans = NULL;		/* for UPDATE/DELETE */
-static int	nPlans = 0;
-
-typedef struct _TTOffList
-{
-	struct _TTOffList *next;
-	char		name[FLEXIBLE_ARRAY_MEMBER];
-} TTOffList;
-
-static TTOffList *TTOff = NULL;
-
-static int	findTTStatus(char *name);
-static EPlan *find_plan(char *ident, EPlan **eplan, int *nplans);
-
-/*
- * timetravel () --
- *		1.  IF an update affects tuple with stop_date eq INFINITY
- *			then form (and return) new tuple with start_date eq current date
- *			and stop_date eq INFINITY [ and update_user eq current user ]
- *			and all other column values as in new tuple, and insert tuple
- *			with old data and stop_date eq current date
- *			ELSE - skip updating of tuple.
- *		2.  IF a delete affects tuple with stop_date eq INFINITY
- *			then insert the same tuple with stop_date eq current date
- *			[ and delete_user eq current user ]
- *			ELSE - skip deletion of tuple.
- *		3.  On INSERT, if start_date is NULL then current date will be
- *			inserted, if stop_date is NULL then INFINITY will be inserted.
- *			[ and insert_user eq current user, update_user and delete_user
- *			eq NULL ]
- *
- * In CREATE TRIGGER you are to specify start_date and stop_date column
- * names:
- * EXECUTE PROCEDURE
- * timetravel ('date_on', 'date_off' [,'insert_user', 'update_user', 'delete_user' ] ).
- */
-
-#define MaxAttrNum	5
-#define MinAttrNum	2
-
-#define a_time_on	0
-#define a_time_off	1
-#define a_ins_user	2
-#define a_upd_user	3
-#define a_del_user	4
-
-PG_FUNCTION_INFO_V1(timetravel);
-
-Datum							/* have to return HeapTuple to Executor */
-timetravel(PG_FUNCTION_ARGS)
-{
-	TriggerData *trigdata = (TriggerData *) fcinfo->context;
-	Trigger    *trigger;		/* to get trigger name */
-	int			argc;
-	char	  **args;			/* arguments */
-	int			attnum[MaxAttrNum]; /* fnumbers of start/stop columns */
-	Datum		oldtimeon,
-				oldtimeoff;
-	Datum		newtimeon,
-				newtimeoff,
-				newuser,
-				nulltext;
-	Datum	   *cvals;			/* column values */
-	char	   *cnulls;			/* column nulls */
-	char	   *relname;		/* triggered relation name */
-	Relation	rel;			/* triggered relation */
-	HeapTuple	trigtuple;
-	HeapTuple	newtuple = NULL;
-	HeapTuple	rettuple;
-	TupleDesc	tupdesc;		/* tuple description */
-	int			natts;			/* # of attributes */
-	EPlan	   *plan;			/* prepared plan */
-	char		ident[2 * NAMEDATALEN];
-	bool		isnull;			/* to know is some column NULL or not */
-	bool		isinsert = false;
-	int			ret;
-	int			i;
-
-	/*
-	 * Some checks first...
-	 */
-
-	/* Called by trigger manager ? */
-	if (!CALLED_AS_TRIGGER(fcinfo))
-		elog(ERROR, "timetravel: not fired by trigger manager");
-
-	/* Should be called for ROW trigger */
-	if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))
-		elog(ERROR, "timetravel: must be fired for row");
-
-	/* Should be called BEFORE */
-	if (!TRIGGER_FIRED_BEFORE(trigdata->tg_event))
-		elog(ERROR, "timetravel: must be fired before event");
-
-	/* INSERT ? */
-	if (TRIGGER_FIRED_BY_INSERT(trigdata->tg_event))
-		isinsert = true;
-
-	if (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event))
-		newtuple = trigdata->tg_newtuple;
-
-	trigtuple = trigdata->tg_trigtuple;
-
-	rel = trigdata->tg_relation;
-	relname = SPI_getrelname(rel);
-
-	/* check if TT is OFF for this relation */
-	if (0 == findTTStatus(relname))
-	{
-		/* OFF - nothing to do */
-		pfree(relname);
-		return PointerGetDatum((newtuple != NULL) ? newtuple : trigtuple);
-	}
-
-	trigger = trigdata->tg_trigger;
-
-	argc = trigger->tgnargs;
-	if (argc != MinAttrNum && argc != MaxAttrNum)
-		elog(ERROR, "timetravel (%s): invalid (!= %d or %d) number of arguments %d",
-			 relname, MinAttrNum, MaxAttrNum, trigger->tgnargs);
-
-	args = trigger->tgargs;
-	tupdesc = rel->rd_att;
-	natts = tupdesc->natts;
-
-	for (i = 0; i < MinAttrNum; i++)
-	{
-		attnum[i] = SPI_fnumber(tupdesc, args[i]);
-		if (attnum[i] <= 0)
-			elog(ERROR, "timetravel (%s): there is no attribute %s", relname, args[i]);
-		if (SPI_gettypeid(tupdesc, attnum[i]) != ABSTIMEOID)
-			elog(ERROR, "timetravel (%s): attribute %s must be of abstime type",
-				 relname, args[i]);
-	}
-	for (; i < argc; i++)
-	{
-		attnum[i] = SPI_fnumber(tupdesc, args[i]);
-		if (attnum[i] <= 0)
-			elog(ERROR, "timetravel (%s): there is no attribute %s", relname, args[i]);
-		if (SPI_gettypeid(tupdesc, attnum[i]) != TEXTOID)
-			elog(ERROR, "timetravel (%s): attribute %s must be of text type",
-				 relname, args[i]);
-	}
-
-	/* create fields containing name */
-	newuser = CStringGetTextDatum(GetUserNameFromId(GetUserId(), false));
-
-	nulltext = (Datum) NULL;
-
-	if (isinsert)
-	{							/* INSERT */
-		int			chnattrs = 0;
-		int			chattrs[MaxAttrNum];
-		Datum		newvals[MaxAttrNum];
-		bool		newnulls[MaxAttrNum];
-
-		oldtimeon = SPI_getbinval(trigtuple, tupdesc, attnum[a_time_on], &isnull);
-		if (isnull)
-		{
-			newvals[chnattrs] = GetCurrentAbsoluteTime();
-			newnulls[chnattrs] = false;
-			chattrs[chnattrs] = attnum[a_time_on];
-			chnattrs++;
-		}
-
-		oldtimeoff = SPI_getbinval(trigtuple, tupdesc, attnum[a_time_off], &isnull);
-		if (isnull)
-		{
-			if ((chnattrs == 0 && DatumGetInt32(oldtimeon) >= NOEND_ABSTIME) ||
-				(chnattrs > 0 && DatumGetInt32(newvals[a_time_on]) >= NOEND_ABSTIME))
-				elog(ERROR, "timetravel (%s): %s is infinity", relname, args[a_time_on]);
-			newvals[chnattrs] = NOEND_ABSTIME;
-			newnulls[chnattrs] = false;
-			chattrs[chnattrs] = attnum[a_time_off];
-			chnattrs++;
-		}
-		else
-		{
-			if ((chnattrs == 0 && DatumGetInt32(oldtimeon) > DatumGetInt32(oldtimeoff)) ||
-				(chnattrs > 0 && DatumGetInt32(newvals[a_time_on]) > DatumGetInt32(oldtimeoff)))
-				elog(ERROR, "timetravel (%s): %s gt %s", relname, args[a_time_on], args[a_time_off]);
-		}
-
-		pfree(relname);
-		if (chnattrs <= 0)
-			return PointerGetDatum(trigtuple);
-
-		if (argc == MaxAttrNum)
-		{
-			/* clear update_user value */
-			newvals[chnattrs] = nulltext;
-			newnulls[chnattrs] = true;
-			chattrs[chnattrs] = attnum[a_upd_user];
-			chnattrs++;
-			/* clear delete_user value */
-			newvals[chnattrs] = nulltext;
-			newnulls[chnattrs] = true;
-			chattrs[chnattrs] = attnum[a_del_user];
-			chnattrs++;
-			/* set insert_user value */
-			newvals[chnattrs] = newuser;
-			newnulls[chnattrs] = false;
-			chattrs[chnattrs] = attnum[a_ins_user];
-			chnattrs++;
-		}
-		rettuple = heap_modify_tuple_by_cols(trigtuple, tupdesc,
-											 chnattrs, chattrs,
-											 newvals, newnulls);
-		return PointerGetDatum(rettuple);
-		/* end of INSERT */
-	}
-
-	/* UPDATE/DELETE: */
-	oldtimeon = SPI_getbinval(trigtuple, tupdesc, attnum[a_time_on], &isnull);
-	if (isnull)
-		elog(ERROR, "timetravel (%s): %s must be NOT NULL", relname, args[a_time_on]);
-
-	oldtimeoff = SPI_getbinval(trigtuple, tupdesc, attnum[a_time_off], &isnull);
-	if (isnull)
-		elog(ERROR, "timetravel (%s): %s must be NOT NULL", relname, args[a_time_off]);
-
-	/*
-	 * If DELETE/UPDATE of tuple with stop_date neq INFINITY then say upper
-	 * Executor to skip operation for this tuple
-	 */
-	if (newtuple != NULL)
-	{							/* UPDATE */
-		newtimeon = SPI_getbinval(newtuple, tupdesc, attnum[a_time_on], &isnull);
-		if (isnull)
-			elog(ERROR, "timetravel (%s): %s must be NOT NULL", relname, args[a_time_on]);
-
-		newtimeoff = SPI_getbinval(newtuple, tupdesc, attnum[a_time_off], &isnull);
-		if (isnull)
-			elog(ERROR, "timetravel (%s): %s must be NOT NULL", relname, args[a_time_off]);
-
-		if (oldtimeon != newtimeon || oldtimeoff != newtimeoff)
-			elog(ERROR, "timetravel (%s): you cannot change %s and/or %s columns (use set_timetravel)",
-				 relname, args[a_time_on], args[a_time_off]);
-	}
-	if (oldtimeoff != NOEND_ABSTIME)
-	{							/* current record is a deleted/updated record */
-		pfree(relname);
-		return PointerGetDatum(NULL);
-	}
-
-	newtimeoff = GetCurrentAbsoluteTime();
-
-	/* Connect to SPI manager */
-	if ((ret = SPI_connect()) < 0)
-		elog(ERROR, "timetravel (%s): SPI_connect returned %d", relname, ret);
-
-	/* Fetch tuple values and nulls */
-	cvals = (Datum *) palloc(natts * sizeof(Datum));
-	cnulls = (char *) palloc(natts * sizeof(char));
-	for (i = 0; i < natts; i++)
-	{
-		cvals[i] = SPI_getbinval(trigtuple, tupdesc, i + 1, &isnull);
-		cnulls[i] = (isnull) ? 'n' : ' ';
-	}
-
-	/* change date column(s) */
-	cvals[attnum[a_time_off] - 1] = newtimeoff; /* stop_date eq current date */
-	cnulls[attnum[a_time_off] - 1] = ' ';
-
-	if (!newtuple)
-	{							/* DELETE */
-		if (argc == MaxAttrNum)
-		{
-			cvals[attnum[a_del_user] - 1] = newuser;	/* set delete user */
-			cnulls[attnum[a_del_user] - 1] = ' ';
-		}
-	}
-
-	/*
-	 * Construct ident string as TriggerName $ TriggeredRelationId and try to
-	 * find prepared execution plan.
-	 */
-	snprintf(ident, sizeof(ident), "%s$%u", trigger->tgname, rel->rd_id);
-	plan = find_plan(ident, &Plans, &nPlans);
-
-	/* if there is no plan ... */
-	if (plan->splan == NULL)
-	{
-		SPIPlanPtr	pplan;
-		Oid		   *ctypes;
-		char		sql[8192];
-		char		separ = ' ';
-
-		/* allocate ctypes for preparation */
-		ctypes = (Oid *) palloc(natts * sizeof(Oid));
-
-		/*
-		 * Construct query: INSERT INTO _relation_ VALUES ($1, ...)
-		 */
-		snprintf(sql, sizeof(sql), "INSERT INTO %s VALUES (", relname);
-		for (i = 1; i <= natts; i++)
-		{
-			ctypes[i - 1] = SPI_gettypeid(tupdesc, i);
-			if (!(TupleDescAttr(tupdesc, i - 1)->attisdropped)) /* skip dropped columns */
-			{
-				snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%c$%d", separ, i);
-				separ = ',';
-			}
-		}
-		snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), ")");
-
-		elog(DEBUG4, "timetravel (%s) update: sql: %s", relname, sql);
-
-		/* Prepare plan for query */
-		pplan = SPI_prepare(sql, natts, ctypes);
-		if (pplan == NULL)
-			elog(ERROR, "timetravel (%s): SPI_prepare returned %s", relname, SPI_result_code_string(SPI_result));
-
-		/*
-		 * Remember that SPI_prepare places plan in current memory context -
-		 * so, we have to save plan in Top memory context for later use.
-		 */
-		if (SPI_keepplan(pplan))
-			elog(ERROR, "timetravel (%s): SPI_keepplan failed", relname);
-
-		plan->splan = pplan;
-	}
-
-	/*
-	 * Ok, execute prepared plan.
-	 */
-	ret = SPI_execp(plan->splan, cvals, cnulls, 0);
-
-	if (ret < 0)
-		elog(ERROR, "timetravel (%s): SPI_execp returned %d", relname, ret);
-
-	/* Tuple to return to upper Executor ... */
-	if (newtuple)
-	{							/* UPDATE */
-		int			chnattrs = 0;
-		int			chattrs[MaxAttrNum];
-		Datum		newvals[MaxAttrNum];
-		char		newnulls[MaxAttrNum];
-
-		newvals[chnattrs] = newtimeoff;
-		newnulls[chnattrs] = ' ';
-		chattrs[chnattrs] = attnum[a_time_on];
-		chnattrs++;
-
-		newvals[chnattrs] = NOEND_ABSTIME;
-		newnulls[chnattrs] = ' ';
-		chattrs[chnattrs] = attnum[a_time_off];
-		chnattrs++;
-
-		if (argc == MaxAttrNum)
-		{
-			/* set update_user value */
-			newvals[chnattrs] = newuser;
-			newnulls[chnattrs] = ' ';
-			chattrs[chnattrs] = attnum[a_upd_user];
-			chnattrs++;
-			/* clear delete_user value */
-			newvals[chnattrs] = nulltext;
-			newnulls[chnattrs] = 'n';
-			chattrs[chnattrs] = attnum[a_del_user];
-			chnattrs++;
-			/* set insert_user value */
-			newvals[chnattrs] = nulltext;
-			newnulls[chnattrs] = 'n';
-			chattrs[chnattrs] = attnum[a_ins_user];
-			chnattrs++;
-		}
-
-		/*
-		 * Use SPI_modifytuple() here because we are inside SPI environment
-		 * but rettuple must be allocated in caller's context.
-		 */
-		rettuple = SPI_modifytuple(rel, newtuple, chnattrs, chattrs, newvals, newnulls);
-	}
-	else
-		/* DELETE case */
-		rettuple = trigtuple;
-
-	SPI_finish();				/* don't forget say Bye to SPI mgr */
-
-	pfree(relname);
-	return PointerGetDatum(rettuple);
-}
-
-/*
- * set_timetravel (relname, on) --
- *					turn timetravel for specified relation ON/OFF
- */
-PG_FUNCTION_INFO_V1(set_timetravel);
-
-Datum
-set_timetravel(PG_FUNCTION_ARGS)
-{
-	Name		relname = PG_GETARG_NAME(0);
-	int32		on = PG_GETARG_INT32(1);
-	char	   *rname;
-	char	   *d;
-	char	   *s;
-	int32		ret;
-	TTOffList  *prev,
-			   *pp;
-
-	prev = NULL;
-	for (pp = TTOff; pp; prev = pp, pp = pp->next)
-	{
-		if (namestrcmp(relname, pp->name) == 0)
-			break;
-	}
-	if (pp)
-	{
-		/* OFF currently */
-		if (on != 0)
-		{
-			/* turn ON */
-			if (prev)
-				prev->next = pp->next;
-			else
-				TTOff = pp->next;
-			free(pp);
-		}
-		ret = 0;
-	}
-	else
-	{
-		/* ON currently */
-		if (on == 0)
-		{
-			/* turn OFF */
-			s = rname = DatumGetCString(DirectFunctionCall1(nameout, NameGetDatum(relname)));
-			if (s)
-			{
-				pp = malloc(offsetof(TTOffList, name) + strlen(rname) + 1);
-				if (pp)
-				{
-					pp->next = NULL;
-					d = pp->name;
-					while (*s)
-						*d++ = tolower((unsigned char) *s++);
-					*d = '\0';
-					if (prev)
-						prev->next = pp;
-					else
-						TTOff = pp;
-				}
-				pfree(rname);
-			}
-		}
-		ret = 1;
-	}
-	PG_RETURN_INT32(ret);
-}
-
-/*
- * get_timetravel (relname) --
- *	get timetravel status for specified relation (ON/OFF)
- */
-PG_FUNCTION_INFO_V1(get_timetravel);
-
-Datum
-get_timetravel(PG_FUNCTION_ARGS)
-{
-	Name		relname = PG_GETARG_NAME(0);
-	TTOffList  *pp;
-
-	for (pp = TTOff; pp; pp = pp->next)
-	{
-		if (namestrcmp(relname, pp->name) == 0)
-			PG_RETURN_INT32(0);
-	}
-	PG_RETURN_INT32(1);
-}
-
-static int
-findTTStatus(char *name)
-{
-	TTOffList  *pp;
-
-	for (pp = TTOff; pp; pp = pp->next)
-		if (pg_strcasecmp(name, pp->name) == 0)
-			return 0;
-	return 1;
-}
-
-/*
-AbsoluteTime
-currabstime()
-{
-	return GetCurrentAbsoluteTime();
-}
-*/
-
-static EPlan *
-find_plan(char *ident, EPlan **eplan, int *nplans)
-{
-	EPlan	   *newp;
-	int			i;
-
-	if (*nplans > 0)
-	{
-		for (i = 0; i < *nplans; i++)
-		{
-			if (strcmp((*eplan)[i].ident, ident) == 0)
-				break;
-		}
-		if (i != *nplans)
-			return (*eplan + i);
-		*eplan = (EPlan *) realloc(*eplan, (i + 1) * sizeof(EPlan));
-		newp = *eplan + i;
-	}
-	else
-	{
-		newp = *eplan = (EPlan *) malloc(sizeof(EPlan));
-		(*nplans) = i = 0;
-	}
-
-	newp->ident = strdup(ident);
-	newp->splan = NULL;
-	(*nplans)++;
-
-	return newp;
-}
diff --git a/contrib/spi/timetravel.control b/contrib/spi/timetravel.control
deleted file mode 100644
index 9b4bb6ba046..00000000000
--- a/contrib/spi/timetravel.control
+++ /dev/null
@@ -1,5 +0,0 @@
-# timetravel extension
-comment = 'functions for implementing time travel'
-default_version = '1.0'
-module_pathname = '$libdir/timetravel'
-relocatable = true
diff --git a/contrib/spi/timetravel.example b/contrib/spi/timetravel.example
deleted file mode 100644
index 35a7f654085..00000000000
--- a/contrib/spi/timetravel.example
+++ /dev/null
@@ -1,81 +0,0 @@
-drop table tttest;
-
-create table tttest (
-	price_id	int4,
-	price_val	int4,
-	price_on	abstime,
-	price_off	abstime
-);
-
-create unique index tttest_idx on tttest (price_id,price_off);
-alter table tttest add column q1 text;
-alter table tttest add column q2 int;
-alter table tttest drop column q1;
-
-create trigger timetravel
-	before insert or delete or update on tttest
-	for each row
-	execute procedure
-	timetravel (price_on, price_off);
-
-insert into tttest values (1, 1, null, null);
-insert into tttest(price_id, price_val) values (2, 2);
-insert into tttest(price_id, price_val,price_off) values (3, 3, 'infinity');
-
-insert into tttest(price_id, price_val,price_off) values (4, 4,
-	abstime('now'::timestamp - '100 days'::interval));
-insert into tttest(price_id, price_val,price_on) values (3, 3, 'infinity'); -- duplicate key
-
-select * from tttest;
-delete from tttest where price_id = 2;
-select * from tttest;
--- what do we see ?
-
--- get current prices
-select * from tttest where price_off = 'infinity';
-
--- change price for price_id == 3
-update tttest set price_val = 30 where price_id = 3;
-select * from tttest;
-
--- now we want to change price_id from 3 to 5 in ALL tuples
--- but this gets us not what we need
-update tttest set price_id = 5 where price_id = 3;
-select * from tttest;
-
--- restore data as before last update:
-select set_timetravel('tttest', 0);	-- turn TT OFF!
-
-select get_timetravel('tttest');	-- check status
-
-delete from tttest where price_id = 5;
-update tttest set price_off = 'infinity' where price_val = 30;
-select * from tttest;
-
--- and try change price_id now!
-update tttest set price_id = 5 where price_id = 3;
-select * from tttest;
--- isn't it what we need ?
-
-select set_timetravel('tttest', 1);	-- turn TT ON!
-
-select get_timetravel('tttest');	-- check status
-
--- we want to correct some date
-update tttest set price_on = 'Jan-01-1990 00:00:01' where price_id = 5 and
-	price_off <> 'infinity';
--- but this doesn't work
-
--- try in this way
-select set_timetravel('tttest', 0);	-- turn TT OFF!
-
-select get_timetravel('tttest');	-- check status
-
-update tttest set price_on = '01-Jan-1990 00:00:01' where price_id = 5 and
-	price_off <> 'infinity';
-select * from tttest;
--- isn't it what we need ?
-
--- get price for price_id == 5 as it was '10-Jan-1990'
-select * from tttest where price_id = 5 and
-	price_on <= '10-Jan-1990' and price_off > '10-Jan-1990';
diff --git a/doc/src/sgml/contrib-spi.sgml b/doc/src/sgml/contrib-spi.sgml
index 844ea161c42..fed6f249328 100644
--- a/doc/src/sgml/contrib-spi.sgml
+++ b/doc/src/sgml/contrib-spi.sgml
@@ -65,99 +65,6 @@
   </para>
  </sect2>
 
- <sect2>
-  <title>timetravel &mdash; Functions for Implementing Time Travel</title>
-
-  <para>
-   Long ago, <productname>PostgreSQL</productname> had a built-in time travel feature
-   that kept the insert and delete times for each tuple.  This can be
-   emulated using these functions.  To use these functions,
-   you must add to a table two columns of <type>abstime</type> type to store
-   the date when a tuple was inserted (start_date) and changed/deleted
-   (stop_date):
-
-<programlisting>
-CREATE TABLE mytab (
-        ...             ...
-        start_date      abstime,
-        stop_date       abstime
-        ...             ...
-);
-</programlisting>
-
-   The columns can be named whatever you like, but in this discussion
-   we'll call them start_date and stop_date.
-  </para>
-
-  <para>
-   When a new row is inserted, start_date should normally be set to
-   current time, and stop_date to <literal>infinity</literal>.  The trigger
-   will automatically substitute these values if the inserted data
-   contains nulls in these columns.  Generally, inserting explicit
-   non-null data in these columns should only be done when re-loading
-   dumped data.
-  </para>
-
-  <para>
-   Tuples with stop_date equal to <literal>infinity</literal> are <quote>valid
-   now</quote>, and can be modified.  Tuples with a finite stop_date cannot
-   be modified anymore &mdash; the trigger will prevent it.  (If you need
-   to do that, you can turn off time travel as shown below.)
-  </para>
-
-  <para>
-   For a modifiable row, on update only the stop_date in the tuple being
-   updated will be changed (to current time) and a new tuple with the modified
-   data will be inserted.  Start_date in this new tuple will be set to current
-   time and stop_date to <literal>infinity</literal>.
-  </para>
-
-  <para>
-   A delete does not actually remove the tuple but only sets its stop_date
-   to current time.
-  </para>
-
-  <para>
-   To query for tuples <quote>valid now</quote>, include
-   <literal>stop_date = 'infinity'</literal> in the query's WHERE condition.
-   (You might wish to incorporate that in a view.)  Similarly, you can
-   query for tuples valid at any past time with suitable conditions on
-   start_date and stop_date.
-  </para>
-
-  <para>
-   <function>timetravel()</function> is the general trigger function that supports
-   this behavior.  Create a <literal>BEFORE INSERT OR UPDATE OR DELETE</literal>
-   trigger using this function on each time-traveled table. Specify two
-   trigger arguments: the actual
-   names of the start_date and stop_date columns.
-   Optionally, you can specify one to three more arguments, which must refer
-   to columns of type <type>text</type>.  The trigger will store the name of
-   the current user into the first of these columns during INSERT, the
-   second column during UPDATE, and the third during DELETE.
-  </para>
-
-  <para>
-   <function>set_timetravel()</function> allows you to turn time-travel on or off for
-   a table.
-   <literal>set_timetravel('mytab', 1)</literal> will turn TT ON for table <literal>mytab</literal>.
-   <literal>set_timetravel('mytab', 0)</literal> will turn TT OFF for table <literal>mytab</literal>.
-   In both cases the old status is reported.  While TT is off, you can modify
-   the start_date and stop_date columns freely.  Note that the on/off status
-   is local to the current database session &mdash; fresh sessions will
-   always start out with TT ON for all tables.
-  </para>
-
-  <para>
-   <function>get_timetravel()</function> returns the TT state for a table without
-   changing it.
-  </para>
-
-  <para>
-   There is an example in <filename>timetravel.example</filename>.
-  </para>
- </sect2>
-
  <sect2>
   <title>autoinc &mdash; Functions for Autoincrementing Fields</title>
 
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index c8ae1a0dc7f..7e1c9ac8480 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -605,7 +605,7 @@ sub CopySubdirFiles
 
 		# Special case for contrib/spi
 		$flist =
-		  "autoinc.example insert_username.example moddatetime.example refint.example timetravel.example"
+		  "autoinc.example insert_username.example moddatetime.example refint.example"
 		  if ($module eq 'spi');
 		foreach my $f (split /\s+/, $flist)
 		{
-- 
2.18.0.rc2.dirty

v1-0002-Remove-deprecated-abstime-reltime-tinterval-datat.patchtext/x-diff; charset=us-asciiDownload
From ec3dbb32edaedec54fbab25c1dc607c935f162ca Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Fri, 28 Sep 2018 15:21:48 -0700
Subject: [PATCH v1 2/2] Remove deprecated abstime, reltime, tinterval
 datatypes and timeofday().

These types have been deprecated for a *long* time, and their code has
not magically gotten better.

The timeofday function was implemented in removed code, as seems
sufficiently weird (returning text) that moving it elsewhere is not
worthwhile.

Author: Andres Freund
Discussion:
    https://postgr.es/m/20171213080506.cwjkpcz3bkk6yz2u@alap3.anarazel.de
    https://postgr.es/m/25615.1513115237@sss.pgh.pa.us
---
 doc/src/sgml/brin.sgml                        |   22 -
 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              | 1570 -----------------
 src/backend/utils/adt/selfuncs.c              |   17 -
 src/bin/pg_dump/pg_dumpall.c                  |    2 +-
 src/include/catalog/pg_aggregate.dat          |    6 -
 src/include/catalog/pg_amop.dat               |   98 -
 src/include/catalog/pg_amproc.dat             |   45 -
 src/include/catalog/pg_cast.dat               |   26 -
 src/include/catalog/pg_opclass.dat            |   16 -
 src/include/catalog/pg_operator.dat           |  141 --
 src/include/catalog/pg_opfamily.dat           |   14 -
 src/include/catalog/pg_proc.dat               |  202 ---
 src/include/catalog/pg_type.dat               |   15 -
 src/include/utils/datetime.h                  |    2 +-
 src/include/utils/nabstime.h                  |  103 --
 src/interfaces/ecpg/ecpglib/execute.c         |    6 -
 .../ecpg/test/expected/thread-thread.c        |    2 +-
 .../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      |   34 +-
 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            |    4 +-
 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/opr_sanity.sql           |    2 -
 src/test/regress/sql/reltime.sql              |   50 -
 src/test/regress/sql/tinterval.sql            |   97 -
 src/test/regress/sql/triggers.sql             |    2 +-
 48 files changed, 36 insertions(+), 3380 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 f47e1968a42..da0c9111534 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -129,17 +129,6 @@ LOG:  request for BRIN range summarization for index "brin_wi_idx" page 128 was
     </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>
@@ -388,17 +377,6 @@ LOG:  request for BRIN range summarization for index "brin_wi_idx" page 128 was
       <literal>&gt;</literal>
      </entry>
     </row>
-    <row>
-     <entry><literal>reltime_minmax_ops</literal></entry>
-     <entry><type>reltime</type></entry>
-     <entry>
-      <literal>&lt;</literal>
-      <literal>&lt;=</literal>
-      <literal>=</literal>
-      <literal>&gt;=</literal>
-      <literal>&gt;</literal>
-     </entry>
-    </row>
     <row>
      <entry><literal>int2_minmax_ops</literal></entry>
      <entry><type>smallint</type></entry>
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 0179deea2e0..6d6fbecd125 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -10646,7 +10646,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>
@@ -11125,7 +11125,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 f9458c9921f..8c38dde8fb8 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -1711,14 +1711,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 9a7f6836581..7f46288d33e 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -7466,22 +7466,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>
@@ -8317,7 +8301,6 @@ SELECT LOCALTIMESTAMP;
 transaction_timestamp()
 statement_timestamp()
 clock_timestamp()
-timeofday()
 now()
 </synopsis>
    </para>
@@ -8334,11 +8317,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 06be04eb5c5..766a372835d 100644
--- a/doc/src/sgml/ref/create_function.sgml
+++ b/doc/src/sgml/ref/create_function.sgml
@@ -330,7 +330,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 1a74d931736..902bf0300a4 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -1551,7 +1551,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>
@@ -2069,16 +2069,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>
@@ -2179,11 +2169,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>
@@ -2209,11 +2194,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 aac148fd350..390a6ea1e05 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 72515524199..077bc405191 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 4b35dbb8bbc..746c7ae8447 100644
--- a/src/backend/utils/adt/Makefile
+++ b/src/backend/utils/adt/Makefile
@@ -17,7 +17,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 87146a21610..cb6b5e55bfc 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"
 
 /*
@@ -1170,55 +1169,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 0ed59f1c347..10ba0a34805 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 6ecb41b98f5..00000000000
--- a/src/backend/utils/adt/nabstime.c
+++ /dev/null
@@ -1,1570 +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-2018, 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 <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 a 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 b8c0e034ca1..e0ece74bb92 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -137,7 +137,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"
@@ -4156,11 +4155,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,
@@ -4583,9 +4579,6 @@ convert_timevalue_to_scalar(Datum value, Oid typid, bool *failure)
 			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:
@@ -4600,16 +4593,6 @@ convert_timevalue_to_scalar(Datum value, Oid typid, bool *failure)
 				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 eb29d318a48..51766264762 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -806,7 +806,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.dat b/src/include/catalog/pg_aggregate.dat
index d2a42985695..b4ce0aabf9a 100644
--- a/src/include/catalog/pg_aggregate.dat
+++ b/src/include/catalog/pg_aggregate.dat
@@ -104,9 +104,6 @@
 { aggfnoid => 'max(float8)', aggtransfn => 'float8larger',
   aggcombinefn => 'float8larger', aggsortop => '>(float8,float8)',
   aggtranstype => 'float8' },
-{ aggfnoid => 'max(abstime)', aggtransfn => 'int4larger',
-  aggcombinefn => 'int4larger', aggsortop => '>(abstime,abstime)',
-  aggtranstype => 'abstime' },
 { aggfnoid => 'max(date)', aggtransfn => 'date_larger',
   aggcombinefn => 'date_larger', aggsortop => '>(date,date)',
   aggtranstype => 'date' },
@@ -169,9 +166,6 @@
 { aggfnoid => 'min(float8)', aggtransfn => 'float8smaller',
   aggcombinefn => 'float8smaller', aggsortop => '<(float8,float8)',
   aggtranstype => 'float8' },
-{ aggfnoid => 'min(abstime)', aggtransfn => 'int4smaller',
-  aggcombinefn => 'int4smaller', aggsortop => '<(abstime,abstime)',
-  aggtranstype => 'abstime' },
 { aggfnoid => 'min(date)', aggtransfn => 'date_smaller',
   aggcombinefn => 'date_smaller', aggsortop => '<(date,date)',
   aggtranstype => 'date' },
diff --git a/src/include/catalog/pg_amop.dat b/src/include/catalog/pg_amop.dat
index a1e57d75fac..075a54c4acc 100644
--- a/src/include/catalog/pg_amop.dat
+++ b/src/include/catalog/pg_amop.dat
@@ -371,24 +371,6 @@
   amoprighttype => 'bytea', amopstrategy => '5', amopopr => '>(bytea,bytea)',
   amopmethod => 'btree' },
 
-# btree abstime_ops
-
-{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '1',
-  amopopr => '<(abstime,abstime)', amopmethod => 'btree' },
-{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '2',
-  amopopr => '<=(abstime,abstime)', amopmethod => 'btree' },
-{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '3',
-  amopopr => '=(abstime,abstime)', amopmethod => 'btree' },
-{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '4',
-  amopopr => '>=(abstime,abstime)', amopmethod => 'btree' },
-{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '5',
-  amopopr => '>(abstime,abstime)', amopmethod => 'btree' },
-
 # btree datetime_ops
 
 # default operators date
@@ -773,42 +755,6 @@
   amoprighttype => 'money', amopstrategy => '5', amopopr => '>(money,money)',
   amopmethod => 'btree' },
 
-# btree reltime_ops
-
-{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '1',
-  amopopr => '<(reltime,reltime)', amopmethod => 'btree' },
-{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '2',
-  amopopr => '<=(reltime,reltime)', amopmethod => 'btree' },
-{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '3',
-  amopopr => '=(reltime,reltime)', amopmethod => 'btree' },
-{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '4',
-  amopopr => '>=(reltime,reltime)', amopmethod => 'btree' },
-{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '5',
-  amopopr => '>(reltime,reltime)', amopmethod => 'btree' },
-
-# btree tinterval_ops
-
-{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval',
-  amoprighttype => 'tinterval', amopstrategy => '1',
-  amopopr => '<(tinterval,tinterval)', amopmethod => 'btree' },
-{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval',
-  amoprighttype => 'tinterval', amopstrategy => '2',
-  amopopr => '<=(tinterval,tinterval)', amopmethod => 'btree' },
-{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval',
-  amoprighttype => 'tinterval', amopstrategy => '3',
-  amopopr => '=(tinterval,tinterval)', amopmethod => 'btree' },
-{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval',
-  amoprighttype => 'tinterval', amopstrategy => '4',
-  amopopr => '>=(tinterval,tinterval)', amopmethod => 'btree' },
-{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval',
-  amoprighttype => 'tinterval', amopstrategy => '5',
-  amopopr => '>(tinterval,tinterval)', amopmethod => 'btree' },
-
 # btree array_ops
 
 { amopfamily => 'btree/array_ops', amoplefttype => 'anyarray',
@@ -1036,16 +982,6 @@
 { amopfamily => 'hash/cid_ops', amoplefttype => 'cid', amoprighttype => 'cid',
   amopstrategy => '1', amopopr => '=(cid,cid)', amopmethod => 'hash' },
 
-# abstime_ops
-{ amopfamily => 'hash/abstime_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '1',
-  amopopr => '=(abstime,abstime)', amopmethod => 'hash' },
-
-# reltime_ops
-{ amopfamily => 'hash/reltime_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '1',
-  amopopr => '=(reltime,reltime)', amopmethod => 'hash' },
-
 # text_pattern_ops
 { amopfamily => 'hash/text_pattern_ops', amoplefttype => 'text',
   amoprighttype => 'text', amopstrategy => '1', amopopr => '=(text,text)',
@@ -1989,40 +1925,6 @@
   amoprighttype => 'float8', amopstrategy => '5', amopopr => '>(float8,float8)',
   amopmethod => 'brin' },
 
-# minmax abstime
-{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '1',
-  amopopr => '<(abstime,abstime)', amopmethod => 'brin' },
-{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '2',
-  amopopr => '<=(abstime,abstime)', amopmethod => 'brin' },
-{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '3',
-  amopopr => '=(abstime,abstime)', amopmethod => 'brin' },
-{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '4',
-  amopopr => '>=(abstime,abstime)', amopmethod => 'brin' },
-{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime',
-  amoprighttype => 'abstime', amopstrategy => '5',
-  amopopr => '>(abstime,abstime)', amopmethod => 'brin' },
-
-# minmax reltime
-{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '1',
-  amopopr => '<(reltime,reltime)', amopmethod => 'brin' },
-{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '2',
-  amopopr => '<=(reltime,reltime)', amopmethod => 'brin' },
-{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '3',
-  amopopr => '=(reltime,reltime)', amopmethod => 'brin' },
-{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '4',
-  amopopr => '>=(reltime,reltime)', amopmethod => 'brin' },
-{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime',
-  amoprighttype => 'reltime', amopstrategy => '5',
-  amopopr => '>(reltime,reltime)', amopmethod => 'brin' },
-
 # minmax macaddr
 { amopfamily => 'brin/macaddr_minmax_ops', amoplefttype => 'macaddr',
   amoprighttype => 'macaddr', amopstrategy => '1',
diff --git a/src/include/catalog/pg_amproc.dat b/src/include/catalog/pg_amproc.dat
index 086f76c4759..0ef2c0885f2 100644
--- a/src/include/catalog/pg_amproc.dat
+++ b/src/include/catalog/pg_amproc.dat
@@ -15,8 +15,6 @@
 # btree
 { amprocfamily => 'btree/array_ops', amproclefttype => 'anyarray',
   amprocrighttype => 'anyarray', amprocnum => '1', amproc => 'btarraycmp' },
-{ amprocfamily => 'btree/abstime_ops', amproclefttype => 'abstime',
-  amprocrighttype => 'abstime', amprocnum => '1', amproc => 'btabstimecmp' },
 { amprocfamily => 'btree/bit_ops', amproclefttype => 'bit',
   amprocrighttype => 'bit', amprocnum => '1', amproc => 'bitcmp' },
 { amprocfamily => 'btree/bool_ops', amproclefttype => 'bool',
@@ -198,11 +196,6 @@
   amproc => 'btbpchar_pattern_sortsupport' },
 { amprocfamily => 'btree/money_ops', amproclefttype => 'money',
   amprocrighttype => 'money', amprocnum => '1', amproc => 'cash_cmp' },
-{ amprocfamily => 'btree/reltime_ops', amproclefttype => 'reltime',
-  amprocrighttype => 'reltime', amprocnum => '1', amproc => 'btreltimecmp' },
-{ amprocfamily => 'btree/tinterval_ops', amproclefttype => 'tinterval',
-  amprocrighttype => 'tinterval', amprocnum => '1',
-  amproc => 'bttintervalcmp' },
 { amprocfamily => 'btree/tid_ops', amproclefttype => 'tid',
   amprocrighttype => 'tid', amprocnum => '1', amproc => 'bttidcmp' },
 { amprocfamily => 'btree/uuid_ops', amproclefttype => 'uuid',
@@ -343,16 +336,6 @@
   amprocrighttype => 'cid', amprocnum => '1', amproc => 'hashint4' },
 { amprocfamily => 'hash/cid_ops', amproclefttype => 'cid',
   amprocrighttype => 'cid', amprocnum => '2', amproc => 'hashint4extended' },
-{ amprocfamily => 'hash/abstime_ops', amproclefttype => 'abstime',
-  amprocrighttype => 'abstime', amprocnum => '1', amproc => 'hashint4' },
-{ amprocfamily => 'hash/abstime_ops', amproclefttype => 'abstime',
-  amprocrighttype => 'abstime', amprocnum => '2',
-  amproc => 'hashint4extended' },
-{ amprocfamily => 'hash/reltime_ops', amproclefttype => 'reltime',
-  amprocrighttype => 'reltime', amprocnum => '1', amproc => 'hashint4' },
-{ amprocfamily => 'hash/reltime_ops', amproclefttype => 'reltime',
-  amprocrighttype => 'reltime', amprocnum => '2',
-  amproc => 'hashint4extended' },
 { amprocfamily => 'hash/text_pattern_ops', amproclefttype => 'text',
   amprocrighttype => 'text', amprocnum => '1', amproc => 'hashtext' },
 { amprocfamily => 'hash/text_pattern_ops', amproclefttype => 'text',
@@ -917,34 +900,6 @@
   amprocrighttype => 'float4', amprocnum => '4',
   amproc => 'brin_minmax_union' },
 
-# minmax abstime
-{ amprocfamily => 'brin/abstime_minmax_ops', amproclefttype => 'abstime',
-  amprocrighttype => 'abstime', amprocnum => '1',
-  amproc => 'brin_minmax_opcinfo' },
-{ amprocfamily => 'brin/abstime_minmax_ops', amproclefttype => 'abstime',
-  amprocrighttype => 'abstime', amprocnum => '2',
-  amproc => 'brin_minmax_add_value' },
-{ amprocfamily => 'brin/abstime_minmax_ops', amproclefttype => 'abstime',
-  amprocrighttype => 'abstime', amprocnum => '3',
-  amproc => 'brin_minmax_consistent' },
-{ amprocfamily => 'brin/abstime_minmax_ops', amproclefttype => 'abstime',
-  amprocrighttype => 'abstime', amprocnum => '4',
-  amproc => 'brin_minmax_union' },
-
-# minmax reltime
-{ amprocfamily => 'brin/reltime_minmax_ops', amproclefttype => 'reltime',
-  amprocrighttype => 'reltime', amprocnum => '1',
-  amproc => 'brin_minmax_opcinfo' },
-{ amprocfamily => 'brin/reltime_minmax_ops', amproclefttype => 'reltime',
-  amprocrighttype => 'reltime', amprocnum => '2',
-  amproc => 'brin_minmax_add_value' },
-{ amprocfamily => 'brin/reltime_minmax_ops', amproclefttype => 'reltime',
-  amprocrighttype => 'reltime', amprocnum => '3',
-  amproc => 'brin_minmax_consistent' },
-{ amprocfamily => 'brin/reltime_minmax_ops', amproclefttype => 'reltime',
-  amprocrighttype => 'reltime', amprocnum => '4',
-  amproc => 'brin_minmax_union' },
-
 # minmax macaddr
 { amprocfamily => 'brin/macaddr_minmax_ops', amproclefttype => 'macaddr',
   amprocrighttype => 'macaddr', amprocnum => '1',
diff --git a/src/include/catalog/pg_cast.dat b/src/include/catalog/pg_cast.dat
index cf007528fde..8cd65b3ab5e 100644
--- a/src/include/catalog/pg_cast.dat
+++ b/src/include/catalog/pg_cast.dat
@@ -325,16 +325,6 @@
   castcontext => 'i', castmethod => 'i' },
 
 # Datetime category
-{ castsource => 'abstime', casttarget => 'date', castfunc => 'date(abstime)',
-  castcontext => 'a', castmethod => 'f' },
-{ castsource => 'abstime', casttarget => 'time', castfunc => 'time(abstime)',
-  castcontext => 'a', castmethod => 'f' },
-{ castsource => 'abstime', casttarget => 'timestamp',
-  castfunc => 'timestamp(abstime)', castcontext => 'i', castmethod => 'f' },
-{ castsource => 'abstime', casttarget => 'timestamptz',
-  castfunc => 'timestamptz(abstime)', castcontext => 'i', castmethod => 'f' },
-{ castsource => 'reltime', casttarget => 'interval',
-  castfunc => 'interval(reltime)', castcontext => 'i', castmethod => 'f' },
 { castsource => 'date', casttarget => 'timestamp',
   castfunc => 'timestamp(date)', castcontext => 'i', castmethod => 'f' },
 { castsource => 'date', casttarget => 'timestamptz',
@@ -343,16 +333,12 @@
   castcontext => 'i', castmethod => 'f' },
 { castsource => 'time', casttarget => 'timetz', castfunc => 'timetz(time)',
   castcontext => 'i', castmethod => 'f' },
-{ castsource => 'timestamp', casttarget => 'abstime',
-  castfunc => 'abstime(timestamp)', castcontext => 'a', castmethod => 'f' },
 { castsource => 'timestamp', casttarget => 'date',
   castfunc => 'date(timestamp)', castcontext => 'a', castmethod => 'f' },
 { castsource => 'timestamp', casttarget => 'time',
   castfunc => 'time(timestamp)', castcontext => 'a', castmethod => 'f' },
 { castsource => 'timestamp', casttarget => 'timestamptz',
   castfunc => 'timestamptz(timestamp)', castcontext => 'i', castmethod => 'f' },
-{ castsource => 'timestamptz', casttarget => 'abstime',
-  castfunc => 'abstime(timestamptz)', castcontext => 'a', castmethod => 'f' },
 { castsource => 'timestamptz', casttarget => 'date',
   castfunc => 'date(timestamptz)', castcontext => 'a', castmethod => 'f' },
 { castsource => 'timestamptz', casttarget => 'time',
@@ -361,23 +347,11 @@
   castfunc => 'timestamp(timestamptz)', castcontext => 'a', castmethod => 'f' },
 { castsource => 'timestamptz', casttarget => 'timetz',
   castfunc => 'timetz(timestamptz)', castcontext => 'a', castmethod => 'f' },
-{ castsource => 'interval', casttarget => 'reltime', castfunc => 'reltime',
-  castcontext => 'a', castmethod => 'f' },
 { castsource => 'interval', casttarget => 'time', castfunc => 'time(interval)',
   castcontext => 'a', castmethod => 'f' },
 { castsource => 'timetz', casttarget => 'time', castfunc => 'time(timetz)',
   castcontext => 'a', castmethod => 'f' },
 
-# Cross-category casts between int4 and abstime, reltime
-{ castsource => 'int4', casttarget => 'abstime', castfunc => '0',
-  castcontext => 'e', castmethod => 'b' },
-{ castsource => 'abstime', casttarget => 'int4', castfunc => '0',
-  castcontext => 'e', castmethod => 'b' },
-{ castsource => 'int4', casttarget => 'reltime', castfunc => '0',
-  castcontext => 'e', castmethod => 'b' },
-{ castsource => 'reltime', casttarget => 'int4', castfunc => '0',
-  castcontext => 'e', castmethod => 'b' },
-
 # Geometric category
 { castsource => 'point', casttarget => 'box', castfunc => 'box(point)',
   castcontext => 'a', castmethod => 'f' },
diff --git a/src/include/catalog/pg_opclass.dat b/src/include/catalog/pg_opclass.dat
index 5271c5c915c..13928ba4a02 100644
--- a/src/include/catalog/pg_opclass.dat
+++ b/src/include/catalog/pg_opclass.dat
@@ -16,8 +16,6 @@
 # referenced in the C code or in built-in catalog entries.  The rest get OIDs
 # assigned on-the-fly during initdb.
 
-{ opcmethod => 'btree', opcname => 'abstime_ops',
-  opcfamily => 'btree/abstime_ops', opcintype => 'abstime' },
 { opcmethod => 'btree', opcname => 'array_ops', opcfamily => 'btree/array_ops',
   opcintype => 'anyarray' },
 { opcmethod => 'hash', opcname => 'array_ops', opcfamily => 'hash/array_ops',
@@ -169,10 +167,6 @@
   opcintype => 'xid' },
 { opcmethod => 'hash', opcname => 'cid_ops', opcfamily => 'hash/cid_ops',
   opcintype => 'cid' },
-{ opcmethod => 'hash', opcname => 'abstime_ops',
-  opcfamily => 'hash/abstime_ops', opcintype => 'abstime' },
-{ opcmethod => 'hash', opcname => 'reltime_ops',
-  opcfamily => 'hash/reltime_ops', opcintype => 'reltime' },
 { opcmethod => 'hash', opcname => 'text_pattern_ops',
   opcfamily => 'hash/text_pattern_ops', opcintype => 'text',
   opcdefault => 'f' },
@@ -182,10 +176,6 @@
 { opcmethod => 'hash', opcname => 'bpchar_pattern_ops',
   opcfamily => 'hash/bpchar_pattern_ops', opcintype => 'bpchar',
   opcdefault => 'f' },
-{ opcmethod => 'btree', opcname => 'reltime_ops',
-  opcfamily => 'btree/reltime_ops', opcintype => 'reltime' },
-{ opcmethod => 'btree', opcname => 'tinterval_ops',
-  opcfamily => 'btree/tinterval_ops', opcintype => 'tinterval' },
 { opcmethod => 'hash', opcname => 'aclitem_ops',
   opcfamily => 'hash/aclitem_ops', opcintype => 'aclitem' },
 { opcmethod => 'gist', opcname => 'box_ops', opcfamily => 'gist/box_ops',
@@ -286,12 +276,6 @@
 { opcmethod => 'brin', opcname => 'float8_minmax_ops',
   opcfamily => 'brin/float_minmax_ops', opcintype => 'float8',
   opckeytype => 'float8' },
-{ opcmethod => 'brin', opcname => 'abstime_minmax_ops',
-  opcfamily => 'brin/abstime_minmax_ops', opcintype => 'abstime',
-  opckeytype => 'abstime' },
-{ opcmethod => 'brin', opcname => 'reltime_minmax_ops',
-  opcfamily => 'brin/reltime_minmax_ops', opcintype => 'reltime',
-  opckeytype => 'reltime' },
 { opcmethod => 'brin', opcname => 'macaddr_minmax_ops',
   opcfamily => 'brin/macaddr_minmax_ops', opcintype => 'macaddr',
   opckeytype => 'macaddr' },
diff --git a/src/include/catalog/pg_operator.dat b/src/include/catalog/pg_operator.dat
index d9b6bad614e..ce23c2f0aa5 100644
--- a/src/include/catalog/pg_operator.dat
+++ b/src/include/catalog/pg_operator.dat
@@ -498,110 +498,6 @@
 { oid => '559', descr => 'negate',
   oprname => '-', oprkind => 'l', oprleft => '0', oprright => 'int2',
   oprresult => 'int2', oprcode => 'int2um' },
-{ oid => '560', descr => 'equal',
-  oprname => '=', oprcanmerge => 't', oprcanhash => 't', oprleft => 'abstime',
-  oprright => 'abstime', oprresult => 'bool', oprcom => '=(abstime,abstime)',
-  oprnegate => '<>(abstime,abstime)', oprcode => 'abstimeeq',
-  oprrest => 'eqsel', oprjoin => 'eqjoinsel' },
-{ oid => '561', descr => 'not equal',
-  oprname => '<>', oprleft => 'abstime', oprright => 'abstime',
-  oprresult => 'bool', oprcom => '<>(abstime,abstime)',
-  oprnegate => '=(abstime,abstime)', oprcode => 'abstimene',
-  oprrest => 'neqsel', oprjoin => 'neqjoinsel' },
-{ oid => '562', descr => 'less than',
-  oprname => '<', oprleft => 'abstime', oprright => 'abstime',
-  oprresult => 'bool', oprcom => '>(abstime,abstime)',
-  oprnegate => '>=(abstime,abstime)', oprcode => 'abstimelt',
-  oprrest => 'scalarltsel', oprjoin => 'scalarltjoinsel' },
-{ oid => '563', descr => 'greater than',
-  oprname => '>', oprleft => 'abstime', oprright => 'abstime',
-  oprresult => 'bool', oprcom => '<(abstime,abstime)',
-  oprnegate => '<=(abstime,abstime)', oprcode => 'abstimegt',
-  oprrest => 'scalargtsel', oprjoin => 'scalargtjoinsel' },
-{ oid => '564', descr => 'less than or equal',
-  oprname => '<=', oprleft => 'abstime', oprright => 'abstime',
-  oprresult => 'bool', oprcom => '>=(abstime,abstime)',
-  oprnegate => '>(abstime,abstime)', oprcode => 'abstimele',
-  oprrest => 'scalarlesel', oprjoin => 'scalarlejoinsel' },
-{ oid => '565', descr => 'greater than or equal',
-  oprname => '>=', oprleft => 'abstime', oprright => 'abstime',
-  oprresult => 'bool', oprcom => '<=(abstime,abstime)',
-  oprnegate => '<(abstime,abstime)', oprcode => 'abstimege',
-  oprrest => 'scalargesel', oprjoin => 'scalargejoinsel' },
-{ oid => '566', descr => 'equal',
-  oprname => '=', oprcanmerge => 't', oprcanhash => 't', oprleft => 'reltime',
-  oprright => 'reltime', oprresult => 'bool', oprcom => '=(reltime,reltime)',
-  oprnegate => '<>(reltime,reltime)', oprcode => 'reltimeeq',
-  oprrest => 'eqsel', oprjoin => 'eqjoinsel' },
-{ oid => '567', descr => 'not equal',
-  oprname => '<>', oprleft => 'reltime', oprright => 'reltime',
-  oprresult => 'bool', oprcom => '<>(reltime,reltime)',
-  oprnegate => '=(reltime,reltime)', oprcode => 'reltimene',
-  oprrest => 'neqsel', oprjoin => 'neqjoinsel' },
-{ oid => '568', descr => 'less than',
-  oprname => '<', oprleft => 'reltime', oprright => 'reltime',
-  oprresult => 'bool', oprcom => '>(reltime,reltime)',
-  oprnegate => '>=(reltime,reltime)', oprcode => 'reltimelt',
-  oprrest => 'scalarltsel', oprjoin => 'scalarltjoinsel' },
-{ oid => '569', descr => 'greater than',
-  oprname => '>', oprleft => 'reltime', oprright => 'reltime',
-  oprresult => 'bool', oprcom => '<(reltime,reltime)',
-  oprnegate => '<=(reltime,reltime)', oprcode => 'reltimegt',
-  oprrest => 'scalargtsel', oprjoin => 'scalargtjoinsel' },
-{ oid => '570', descr => 'less than or equal',
-  oprname => '<=', oprleft => 'reltime', oprright => 'reltime',
-  oprresult => 'bool', oprcom => '>=(reltime,reltime)',
-  oprnegate => '>(reltime,reltime)', oprcode => 'reltimele',
-  oprrest => 'scalarlesel', oprjoin => 'scalarlejoinsel' },
-{ oid => '571', descr => 'greater than or equal',
-  oprname => '>=', oprleft => 'reltime', oprright => 'reltime',
-  oprresult => 'bool', oprcom => '<=(reltime,reltime)',
-  oprnegate => '<(reltime,reltime)', oprcode => 'reltimege',
-  oprrest => 'scalargesel', oprjoin => 'scalargejoinsel' },
-{ oid => '572', descr => 'same as',
-  oprname => '~=', oprleft => 'tinterval', oprright => 'tinterval',
-  oprresult => 'bool', oprcom => '~=(tinterval,tinterval)',
-  oprcode => 'tintervalsame', oprrest => 'eqsel', oprjoin => 'eqjoinsel' },
-{ oid => '573', descr => 'contains',
-  oprname => '<<', oprleft => 'tinterval', oprright => 'tinterval',
-  oprresult => 'bool', oprcode => 'tintervalct' },
-{ oid => '574', descr => 'overlaps',
-  oprname => '&&', oprleft => 'tinterval', oprright => 'tinterval',
-  oprresult => 'bool', oprcom => '&&(tinterval,tinterval)',
-  oprcode => 'tintervalov' },
-{ oid => '575', descr => 'equal by length',
-  oprname => '#=', oprleft => 'tinterval', oprright => 'reltime',
-  oprresult => 'bool', oprnegate => '#<>(tinterval,reltime)',
-  oprcode => 'tintervalleneq' },
-{ oid => '576', descr => 'not equal by length',
-  oprname => '#<>', oprleft => 'tinterval', oprright => 'reltime',
-  oprresult => 'bool', oprnegate => '#=(tinterval,reltime)',
-  oprcode => 'tintervallenne' },
-{ oid => '577', descr => 'less than by length',
-  oprname => '#<', oprleft => 'tinterval', oprright => 'reltime',
-  oprresult => 'bool', oprnegate => '#>=(tinterval,reltime)',
-  oprcode => 'tintervallenlt' },
-{ oid => '578', descr => 'greater than by length',
-  oprname => '#>', oprleft => 'tinterval', oprright => 'reltime',
-  oprresult => 'bool', oprnegate => '#<=(tinterval,reltime)',
-  oprcode => 'tintervallengt' },
-{ oid => '579', descr => 'less than or equal by length',
-  oprname => '#<=', oprleft => 'tinterval', oprright => 'reltime',
-  oprresult => 'bool', oprnegate => '#>(tinterval,reltime)',
-  oprcode => 'tintervallenle' },
-{ oid => '580', descr => 'greater than or equal by length',
-  oprname => '#>=', oprleft => 'tinterval', oprright => 'reltime',
-  oprresult => 'bool', oprnegate => '#<(tinterval,reltime)',
-  oprcode => 'tintervallenge' },
-{ oid => '581', descr => 'add',
-  oprname => '+', oprleft => 'abstime', oprright => 'reltime',
-  oprresult => 'abstime', oprcode => 'timepl' },
-{ oid => '582', descr => 'subtract',
-  oprname => '-', oprleft => 'abstime', oprright => 'reltime',
-  oprresult => 'abstime', oprcode => 'timemi' },
-{ oid => '583', descr => 'is contained by',
-  oprname => '<?>', oprleft => 'abstime', oprright => 'tinterval',
-  oprresult => 'bool', oprcode => 'intinterval' },
 { oid => '584', descr => 'negate',
   oprname => '-', oprkind => 'l', oprleft => '0', oprright => 'float4',
   oprresult => 'float4', oprcode => 'float4um' },
@@ -644,12 +540,6 @@
 { oid => '597', descr => 'cube root',
   oprname => '||/', oprkind => 'l', oprleft => '0', oprright => 'float8',
   oprresult => 'float8', oprcode => 'dcbrt' },
-{ oid => '1284', descr => 'start of interval',
-  oprname => '|', oprkind => 'l', oprleft => '0', oprright => 'tinterval',
-  oprresult => 'abstime', oprcode => 'tintervalstart' },
-{ oid => '606', descr => 'convert to tinterval',
-  oprname => '<#>', oprleft => 'abstime', oprright => 'abstime',
-  oprresult => 'tinterval', oprcode => 'mktinterval' },
 
 { oid => '607', descr => 'equal',
   oprname => '=', oprcanmerge => 't', oprcanhash => 't', oprleft => 'oid',
@@ -1075,37 +965,6 @@
   oprname => '?|', oprleft => 'point', oprright => 'point', oprresult => 'bool',
   oprcom => '?|(point,point)', oprcode => 'point_vert' },
 
-{ oid => '811', descr => 'equal',
-  oprname => '=', oprcanmerge => 't', oprleft => 'tinterval',
-  oprright => 'tinterval', oprresult => 'bool',
-  oprcom => '=(tinterval,tinterval)', oprnegate => '<>(tinterval,tinterval)',
-  oprcode => 'tintervaleq', oprrest => 'eqsel', oprjoin => 'eqjoinsel' },
-{ oid => '812', descr => 'not equal',
-  oprname => '<>', oprleft => 'tinterval', oprright => 'tinterval',
-  oprresult => 'bool', oprcom => '<>(tinterval,tinterval)',
-  oprnegate => '=(tinterval,tinterval)', oprcode => 'tintervalne',
-  oprrest => 'neqsel', oprjoin => 'neqjoinsel' },
-{ oid => '813', descr => 'less than',
-  oprname => '<', oprleft => 'tinterval', oprright => 'tinterval',
-  oprresult => 'bool', oprcom => '>(tinterval,tinterval)',
-  oprnegate => '>=(tinterval,tinterval)', oprcode => 'tintervallt',
-  oprrest => 'scalarltsel', oprjoin => 'scalarltjoinsel' },
-{ oid => '814', descr => 'greater than',
-  oprname => '>', oprleft => 'tinterval', oprright => 'tinterval',
-  oprresult => 'bool', oprcom => '<(tinterval,tinterval)',
-  oprnegate => '<=(tinterval,tinterval)', oprcode => 'tintervalgt',
-  oprrest => 'scalargtsel', oprjoin => 'scalargtjoinsel' },
-{ oid => '815', descr => 'less than or equal',
-  oprname => '<=', oprleft => 'tinterval', oprright => 'tinterval',
-  oprresult => 'bool', oprcom => '>=(tinterval,tinterval)',
-  oprnegate => '>(tinterval,tinterval)', oprcode => 'tintervalle',
-  oprrest => 'scalarlesel', oprjoin => 'scalarlejoinsel' },
-{ oid => '816', descr => 'greater than or equal',
-  oprname => '>=', oprleft => 'tinterval', oprright => 'tinterval',
-  oprresult => 'bool', oprcom => '<=(tinterval,tinterval)',
-  oprnegate => '<(tinterval,tinterval)', oprcode => 'tintervalge',
-  oprrest => 'scalargesel', oprjoin => 'scalargejoinsel' },
-
 { oid => '843', descr => 'multiply',
   oprname => '*', oprleft => 'money', oprright => 'float4',
   oprresult => 'money', oprcom => '*(float4,money)',
diff --git a/src/include/catalog/pg_opfamily.dat b/src/include/catalog/pg_opfamily.dat
index 4a9a28b87e1..20b2224c54d 100644
--- a/src/include/catalog/pg_opfamily.dat
+++ b/src/include/catalog/pg_opfamily.dat
@@ -12,8 +12,6 @@
 
 [
 
-{ oid => '421',
-  opfmethod => 'btree', opfname => 'abstime_ops' },
 { oid => '397',
   opfmethod => 'btree', opfname => 'array_ops' },
 { oid => '627',
@@ -118,18 +116,10 @@
   opfmethod => 'hash', opfname => 'xid_ops' },
 { oid => '2226',
   opfmethod => 'hash', opfname => 'cid_ops' },
-{ oid => '2227',
-  opfmethod => 'hash', opfname => 'abstime_ops' },
-{ oid => '2228',
-  opfmethod => 'hash', opfname => 'reltime_ops' },
 { oid => '2229',
   opfmethod => 'hash', opfname => 'text_pattern_ops' },
 { oid => '2231',
   opfmethod => 'hash', opfname => 'bpchar_pattern_ops' },
-{ oid => '2233',
-  opfmethod => 'btree', opfname => 'reltime_ops' },
-{ oid => '2234',
-  opfmethod => 'btree', opfname => 'tinterval_ops' },
 { oid => '2235',
   opfmethod => 'hash', opfname => 'aclitem_ops' },
 { oid => '2593',
@@ -210,10 +200,6 @@
   opfmethod => 'brin', opfname => 'tid_minmax_ops' },
 { oid => '4070',
   opfmethod => 'brin', opfname => 'float_minmax_ops' },
-{ oid => '4072',
-  opfmethod => 'brin', opfname => 'abstime_minmax_ops' },
-{ oid => '4073',
-  opfmethod => 'brin', opfname => 'reltime_minmax_ops' },
 { oid => '4074',
   opfmethod => 'brin', opfname => 'macaddr_minmax_ops' },
 { oid => '4109',
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 8e4145f42b4..5aa58b35017 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -673,115 +673,6 @@
   proname => 'line_distance', prorettype => 'float8',
   proargtypes => 'line line', prosrc => 'line_distance' },
 
-{ oid => '240', descr => 'I/O',
-  proname => 'abstimein', provolatile => 's', prorettype => 'abstime',
-  proargtypes => 'cstring', prosrc => 'abstimein' },
-{ oid => '241', descr => 'I/O',
-  proname => 'abstimeout', provolatile => 's', prorettype => 'cstring',
-  proargtypes => 'abstime', prosrc => 'abstimeout' },
-{ oid => '242', descr => 'I/O',
-  proname => 'reltimein', provolatile => 's', prorettype => 'reltime',
-  proargtypes => 'cstring', prosrc => 'reltimein' },
-{ oid => '243', descr => 'I/O',
-  proname => 'reltimeout', provolatile => 's', prorettype => 'cstring',
-  proargtypes => 'reltime', prosrc => 'reltimeout' },
-{ oid => '244',
-  proname => 'timepl', prorettype => 'abstime',
-  proargtypes => 'abstime reltime', prosrc => 'timepl' },
-{ oid => '245',
-  proname => 'timemi', prorettype => 'abstime',
-  proargtypes => 'abstime reltime', prosrc => 'timemi' },
-{ oid => '246', descr => 'I/O',
-  proname => 'tintervalin', provolatile => 's', prorettype => 'tinterval',
-  proargtypes => 'cstring', prosrc => 'tintervalin' },
-{ oid => '247', descr => 'I/O',
-  proname => 'tintervalout', provolatile => 's', prorettype => 'cstring',
-  proargtypes => 'tinterval', prosrc => 'tintervalout' },
-{ oid => '248',
-  proname => 'intinterval', prorettype => 'bool',
-  proargtypes => 'abstime tinterval', prosrc => 'intinterval' },
-{ oid => '249', descr => 'tinterval to reltime',
-  proname => 'tintervalrel', prorettype => 'reltime',
-  proargtypes => 'tinterval', prosrc => 'tintervalrel' },
-{ oid => '250', descr => 'current date and time (abstime)',
-  proname => 'timenow', provolatile => 's', prorettype => 'abstime',
-  proargtypes => '', prosrc => 'timenow' },
-{ oid => '251',
-  proname => 'abstimeeq', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'abstime abstime', prosrc => 'abstimeeq' },
-{ oid => '252',
-  proname => 'abstimene', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'abstime abstime', prosrc => 'abstimene' },
-{ oid => '253',
-  proname => 'abstimelt', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'abstime abstime', prosrc => 'abstimelt' },
-{ oid => '254',
-  proname => 'abstimegt', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'abstime abstime', prosrc => 'abstimegt' },
-{ oid => '255',
-  proname => 'abstimele', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'abstime abstime', prosrc => 'abstimele' },
-{ oid => '256',
-  proname => 'abstimege', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'abstime abstime', prosrc => 'abstimege' },
-{ oid => '257',
-  proname => 'reltimeeq', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'reltime reltime', prosrc => 'reltimeeq' },
-{ oid => '258',
-  proname => 'reltimene', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'reltime reltime', prosrc => 'reltimene' },
-{ oid => '259',
-  proname => 'reltimelt', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'reltime reltime', prosrc => 'reltimelt' },
-{ oid => '260',
-  proname => 'reltimegt', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'reltime reltime', prosrc => 'reltimegt' },
-{ oid => '261',
-  proname => 'reltimele', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'reltime reltime', prosrc => 'reltimele' },
-{ oid => '262',
-  proname => 'reltimege', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'reltime reltime', prosrc => 'reltimege' },
-{ oid => '263',
-  proname => 'tintervalsame', prorettype => 'bool',
-  proargtypes => 'tinterval tinterval', prosrc => 'tintervalsame' },
-{ oid => '264',
-  proname => 'tintervalct', prorettype => 'bool',
-  proargtypes => 'tinterval tinterval', prosrc => 'tintervalct' },
-{ oid => '265',
-  proname => 'tintervalov', prorettype => 'bool',
-  proargtypes => 'tinterval tinterval', prosrc => 'tintervalov' },
-{ oid => '266',
-  proname => 'tintervalleneq', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval reltime', prosrc => 'tintervalleneq' },
-{ oid => '267',
-  proname => 'tintervallenne', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval reltime', prosrc => 'tintervallenne' },
-{ oid => '268',
-  proname => 'tintervallenlt', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval reltime', prosrc => 'tintervallenlt' },
-{ oid => '269',
-  proname => 'tintervallengt', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval reltime', prosrc => 'tintervallengt' },
-{ oid => '270',
-  proname => 'tintervallenle', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval reltime', prosrc => 'tintervallenle' },
-{ oid => '271',
-  proname => 'tintervallenge', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval reltime', prosrc => 'tintervallenge' },
-{ oid => '272',
-  proname => 'tintervalstart', prorettype => 'abstime',
-  proargtypes => 'tinterval', prosrc => 'tintervalstart' },
-{ oid => '273', descr => 'end of interval',
-  proname => 'tintervalend', prorettype => 'abstime',
-  proargtypes => 'tinterval', prosrc => 'tintervalend' },
-{ oid => '274',
-  descr => 'current date and time - increments during transactions',
-  proname => 'timeofday', provolatile => 'v', prorettype => 'text',
-  proargtypes => '', prosrc => 'timeofday' },
-{ oid => '275', descr => 'finite abstime?',
-  proname => 'isfinite', prorettype => 'bool', proargtypes => 'abstime',
-  prosrc => 'abstime_finite' },
 
 { oid => '277',
   proname => 'inter_sl', prorettype => 'bool', proargtypes => 'lseg line',
@@ -1042,9 +933,6 @@
 { oid => '404', descr => 'less-equal-greater',
   proname => 'btoidvectorcmp', prorettype => 'int4',
   proargtypes => 'oidvector oidvector', prosrc => 'btoidvectorcmp' },
-{ oid => '357', descr => 'less-equal-greater',
-  proname => 'btabstimecmp', proleakproof => 't', prorettype => 'int4',
-  proargtypes => 'abstime abstime', prosrc => 'btabstimecmp' },
 { oid => '358', descr => 'less-equal-greater',
   proname => 'btcharcmp', proleakproof => 't', prorettype => 'int4',
   proargtypes => 'char char', prosrc => 'btcharcmp' },
@@ -1063,12 +951,6 @@
 { oid => '377', descr => 'less-equal-greater',
   proname => 'cash_cmp', proleakproof => 't', prorettype => 'int4',
   proargtypes => 'money money', prosrc => 'cash_cmp' },
-{ oid => '380', descr => 'less-equal-greater',
-  proname => 'btreltimecmp', proleakproof => 't', prorettype => 'int4',
-  proargtypes => 'reltime reltime', prosrc => 'btreltimecmp' },
-{ oid => '381', descr => 'less-equal-greater',
-  proname => 'bttintervalcmp', proleakproof => 't', prorettype => 'int4',
-  proargtypes => 'tinterval tinterval', prosrc => 'bttintervalcmp' },
 { oid => '382', descr => 'less-equal-greater',
   proname => 'btarraycmp', prorettype => 'int4',
   proargtypes => 'anyarray anyarray', prosrc => 'btarraycmp' },
@@ -1401,10 +1283,6 @@
   prorettype => 'varchar', proargtypes => 'varchar int4 bool',
   prosrc => 'varchar' },
 
-{ oid => '676',
-  proname => 'mktinterval', prorettype => 'tinterval',
-  proargtypes => 'abstime abstime', prosrc => 'mktinterval' },
-
 { oid => '619',
   proname => 'oidvectorne', prorettype => 'bool',
   proargtypes => 'oidvector oidvector', prosrc => 'oidvectorne' },
@@ -1689,25 +1567,6 @@
   proname => 'int2smaller', prorettype => 'int2', proargtypes => 'int2 int2',
   prosrc => 'int2smaller' },
 
-{ oid => '784',
-  proname => 'tintervaleq', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval tinterval', prosrc => 'tintervaleq' },
-{ oid => '785',
-  proname => 'tintervalne', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval tinterval', prosrc => 'tintervalne' },
-{ oid => '786',
-  proname => 'tintervallt', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval tinterval', prosrc => 'tintervallt' },
-{ oid => '787',
-  proname => 'tintervalgt', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval tinterval', prosrc => 'tintervalgt' },
-{ oid => '788',
-  proname => 'tintervalle', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval tinterval', prosrc => 'tintervalle' },
-{ oid => '789',
-  proname => 'tintervalge', proleakproof => 't', prorettype => 'bool',
-  proargtypes => 'tinterval tinterval', prosrc => 'tintervalge' },
-
 # OIDS 800 - 899
 
 { oid => '846',
@@ -2332,9 +2191,6 @@
 { oid => '1172', descr => 'extract field from interval',
   proname => 'date_part', prorettype => 'float8',
   proargtypes => 'text interval', prosrc => 'interval_part' },
-{ oid => '1173', descr => 'convert abstime to timestamp with time zone',
-  proname => 'timestamptz', prorettype => 'timestamptz',
-  proargtypes => 'abstime', prosrc => 'abstime_timestamptz' },
 { oid => '1174', descr => 'convert date to timestamp with time zone',
   proname => 'timestamptz', provolatile => 's', prorettype => 'timestamptz',
   proargtypes => 'date', prosrc => 'date_timestamptz' },
@@ -2352,18 +2208,9 @@
   proname => 'timestamptz', prolang => '14', provolatile => 's',
   prorettype => 'timestamptz', proargtypes => 'date time',
   prosrc => 'select cast(($1 + $2) as timestamp with time zone)' },
-{ oid => '1177', descr => 'convert reltime to interval',
-  proname => 'interval', prorettype => 'interval', proargtypes => 'reltime',
-  prosrc => 'reltime_interval' },
 { oid => '1178', descr => 'convert timestamp with time zone to date',
   proname => 'date', provolatile => 's', prorettype => 'date',
   proargtypes => 'timestamptz', prosrc => 'timestamptz_date' },
-{ oid => '1179', descr => 'convert abstime to date',
-  proname => 'date', provolatile => 's', prorettype => 'date',
-  proargtypes => 'abstime', prosrc => 'abstime_date' },
-{ oid => '1180', descr => 'convert timestamp with time zone to abstime',
-  proname => 'abstime', prorettype => 'abstime', proargtypes => 'timestamptz',
-  prosrc => 'timestamptz_abstime' },
 { oid => '1181',
   descr => 'age of a transaction ID, in transactions before current transaction',
   proname => 'age', provolatile => 's', proparallel => 'r',
@@ -2384,9 +2231,6 @@
   proname => 'timestamptz_mi_interval', provolatile => 's',
   prorettype => 'timestamptz', proargtypes => 'timestamptz interval',
   prosrc => 'timestamptz_mi_interval' },
-{ oid => '1194', descr => 'convert interval to reltime',
-  proname => 'reltime', prorettype => 'reltime', proargtypes => 'interval',
-  prosrc => 'interval_reltime' },
 { oid => '1195', descr => 'smaller of two',
   proname => 'timestamptz_smaller', prorettype => 'timestamptz',
   proargtypes => 'timestamptz timestamptz', prosrc => 'timestamp_smaller' },
@@ -2785,11 +2629,6 @@
   proname => 'timestamptz', prorettype => 'timestamptz',
   proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
 
-{ oid => '1364', descr => 'convert abstime to time',
-  proname => 'time', prolang => '14', provolatile => 's', prorettype => 'time',
-  proargtypes => 'abstime',
-  prosrc => 'select cast(cast($1 as timestamp without time zone) as pg_catalog.time)' },
-
 { oid => '1367', descr => 'character length',
   proname => 'character_length', prorettype => 'int4', proargtypes => 'bpchar',
   prosrc => 'bpcharlen' },
@@ -2827,14 +2666,6 @@
   proname => 'char_length', prorettype => 'int4', proargtypes => 'text',
   prosrc => 'textlen' },
 
-{ oid => '1382', descr => 'extract field from abstime',
-  proname => 'date_part', prolang => '14', provolatile => 's',
-  prorettype => 'float8', proargtypes => 'text abstime',
-  prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp with time zone))' },
-{ oid => '1383', descr => 'extract field from reltime',
-  proname => 'date_part', prolang => '14', provolatile => 's',
-  prorettype => 'float8', proargtypes => 'text reltime',
-  prosrc => 'select pg_catalog.date_part($1, cast($2 as pg_catalog.interval))' },
 { oid => '1384', descr => 'extract field from date',
   proname => 'date_part', prolang => '14', prorettype => 'float8',
   proargtypes => 'text date',
@@ -3131,9 +2962,6 @@
 { oid => '1480', descr => 'convert circle to box',
   proname => 'box', prorettype => 'box', proargtypes => 'circle',
   prosrc => 'circle_box' },
-{ oid => '1481', descr => 'convert to tinterval',
-  proname => 'tinterval', prorettype => 'tinterval',
-  proargtypes => 'abstime abstime', prosrc => 'mktinterval' },
 
 { oid => '1482',
   proname => 'lseg_ne', proleakproof => 't', prorettype => 'bool',
@@ -5641,9 +5469,6 @@
 { oid => '2021', descr => 'extract field from timestamp',
   proname => 'date_part', prorettype => 'float8',
   proargtypes => 'text timestamp', prosrc => 'timestamp_part' },
-{ oid => '2023', descr => 'convert abstime to timestamp',
-  proname => 'timestamp', provolatile => 's', prorettype => 'timestamp',
-  proargtypes => 'abstime', prosrc => 'abstime_timestamp' },
 { oid => '2024', descr => 'convert date to timestamp',
   proname => 'timestamp', prorettype => 'timestamp', proargtypes => 'date',
   prosrc => 'date_timestamp' },
@@ -5659,9 +5484,6 @@
 { oid => '2029', descr => 'convert timestamp to date',
   proname => 'date', prorettype => 'date', proargtypes => 'timestamp',
   prosrc => 'timestamp_date' },
-{ oid => '2030', descr => 'convert timestamp to abstime',
-  proname => 'abstime', provolatile => 's', prorettype => 'abstime',
-  proargtypes => 'timestamp', prosrc => 'timestamp_abstime' },
 { oid => '2031',
   proname => 'timestamp_mi', prorettype => 'interval',
   proargtypes => 'timestamp timestamp', prosrc => 'timestamp_mi' },
@@ -6217,9 +6039,6 @@
 { oid => '2120', descr => 'maximum value of all float8 input values',
   proname => 'max', prokind => 'a', proisstrict => 'f', prorettype => 'float8',
   proargtypes => 'float8', prosrc => 'aggregate_dummy' },
-{ oid => '2121', descr => 'maximum value of all abstime input values',
-  proname => 'max', prokind => 'a', proisstrict => 'f', prorettype => 'abstime',
-  proargtypes => 'abstime', prosrc => 'aggregate_dummy' },
 { oid => '2122', descr => 'maximum value of all date input values',
   proname => 'max', prokind => 'a', proisstrict => 'f', prorettype => 'date',
   proargtypes => 'date', prosrc => 'aggregate_dummy' },
@@ -6284,9 +6103,6 @@
 { oid => '2136', descr => 'minimum value of all float8 input values',
   proname => 'min', prokind => 'a', proisstrict => 'f', prorettype => 'float8',
   proargtypes => 'float8', prosrc => 'aggregate_dummy' },
-{ oid => '2137', descr => 'minimum value of all abstime input values',
-  proname => 'min', prokind => 'a', proisstrict => 'f', prorettype => 'abstime',
-  proargtypes => 'abstime', prosrc => 'aggregate_dummy' },
 { oid => '2138', descr => 'minimum value of all date input values',
   proname => 'min', prokind => 'a', proisstrict => 'f', prorettype => 'date',
   proargtypes => 'date', prosrc => 'aggregate_dummy' },
@@ -7461,24 +7277,6 @@
 { oid => '2461', descr => 'I/O',
   proname => 'numeric_send', prorettype => 'bytea', proargtypes => 'numeric',
   prosrc => 'numeric_send' },
-{ oid => '2462', descr => 'I/O',
-  proname => 'abstimerecv', prorettype => 'abstime', proargtypes => 'internal',
-  prosrc => 'abstimerecv' },
-{ oid => '2463', descr => 'I/O',
-  proname => 'abstimesend', prorettype => 'bytea', proargtypes => 'abstime',
-  prosrc => 'abstimesend' },
-{ oid => '2464', descr => 'I/O',
-  proname => 'reltimerecv', prorettype => 'reltime', proargtypes => 'internal',
-  prosrc => 'reltimerecv' },
-{ oid => '2465', descr => 'I/O',
-  proname => 'reltimesend', prorettype => 'bytea', proargtypes => 'reltime',
-  prosrc => 'reltimesend' },
-{ oid => '2466', descr => 'I/O',
-  proname => 'tintervalrecv', prorettype => 'tinterval',
-  proargtypes => 'internal', prosrc => 'tintervalrecv' },
-{ oid => '2467', descr => 'I/O',
-  proname => 'tintervalsend', prorettype => 'bytea', proargtypes => 'tinterval',
-  prosrc => 'tintervalsend' },
 { oid => '2468', descr => 'I/O',
   proname => 'date_recv', prorettype => 'date', proargtypes => 'internal',
   prosrc => 'date_recv' },
diff --git a/src/include/catalog/pg_type.dat b/src/include/catalog/pg_type.dat
index 5840f989e51..d295eae1b99 100644
--- a/src/include/catalog/pg_type.dat
+++ b/src/include/catalog/pg_type.dat
@@ -225,21 +225,6 @@
   typcategory => 'N', typispreferred => 't', typinput => 'float8in',
   typoutput => 'float8out', typreceive => 'float8recv', typsend => 'float8send',
   typalign => 'd' },
-{ oid => '702', array_type_oid => '1023',
-  descr => 'absolute, limited-range date and time (Unix system time)',
-  typname => 'abstime', typlen => '4', typbyval => 't', typcategory => 'D',
-  typinput => 'abstimein', typoutput => 'abstimeout',
-  typreceive => 'abstimerecv', typsend => 'abstimesend', typalign => 'i' },
-{ oid => '703', array_type_oid => '1024',
-  descr => 'relative, limited-range time interval (Unix delta time)',
-  typname => 'reltime', typlen => '4', typbyval => 't', typcategory => 'T',
-  typinput => 'reltimein', typoutput => 'reltimeout',
-  typreceive => 'reltimerecv', typsend => 'reltimesend', typalign => 'i' },
-{ oid => '704', array_type_oid => '1025',
-  descr => '(abstime,abstime), time interval',
-  typname => 'tinterval', typlen => '12', typbyval => 'f', typcategory => 'T',
-  typinput => 'tintervalin', typoutput => 'tintervalout',
-  typreceive => 'tintervalrecv', typsend => 'tintervalsend', typalign => 'i' },
 { oid => '705', descr => 'pseudo-type representing an undetermined type',
   typname => 'unknown', typlen => '-2', typbyval => 'f', typtype => 'p',
   typcategory => 'X', typinput => 'unknownin', typoutput => 'unknownout',
diff --git a/src/include/utils/datetime.h b/src/include/utils/datetime.h
index d66582b7a2b..de9e9ade5c8 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-2018, PostgreSQL Global Development Group
diff --git a/src/include/utils/nabstime.h b/src/include/utils/nabstime.h
deleted file mode 100644
index 293a49f022e..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-2018, 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 8569ca55df0..ff244498da4 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -222,12 +222,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/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 dccc9b27c59..585600c154a 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -23,9 +23,7 @@ ALTER TABLE attmp ADD COLUMN d float8;
 ALTER TABLE attmp ADD COLUMN e float4;
 ALTER TABLE attmp ADD COLUMN f int2;
 ALTER TABLE attmp ADD COLUMN g polygon;
-ALTER TABLE attmp ADD COLUMN h abstime;
 ALTER TABLE attmp ADD COLUMN i char;
-ALTER TABLE attmp ADD COLUMN j abstime[];
 ALTER TABLE attmp ADD COLUMN k int4;
 ALTER TABLE attmp ADD COLUMN l tid;
 ALTER TABLE attmp ADD COLUMN m xid;
@@ -36,24 +34,23 @@ ALTER TABLE attmp ADD COLUMN q point;
 ALTER TABLE attmp ADD COLUMN r lseg;
 ALTER TABLE attmp ADD COLUMN s path;
 ALTER TABLE attmp ADD COLUMN t box;
-ALTER TABLE attmp ADD COLUMN u tinterval;
 ALTER TABLE attmp ADD COLUMN v timestamp;
 ALTER TABLE attmp ADD COLUMN w interval;
 ALTER TABLE attmp ADD COLUMN x float8[];
 ALTER TABLE attmp ADD COLUMN y float4[];
 ALTER TABLE attmp ADD COLUMN z int2[];
-INSERT INTO attmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
+INSERT INTO attmp (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 attmp;
- 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 attmp;
@@ -68,9 +65,7 @@ ALTER TABLE attmp ADD COLUMN d float8;
 ALTER TABLE attmp ADD COLUMN e float4;
 ALTER TABLE attmp ADD COLUMN f int2;
 ALTER TABLE attmp ADD COLUMN g polygon;
-ALTER TABLE attmp ADD COLUMN h abstime;
 ALTER TABLE attmp ADD COLUMN i char;
-ALTER TABLE attmp ADD COLUMN j abstime[];
 ALTER TABLE attmp ADD COLUMN k int4;
 ALTER TABLE attmp ADD COLUMN l tid;
 ALTER TABLE attmp ADD COLUMN m xid;
@@ -81,24 +76,23 @@ ALTER TABLE attmp ADD COLUMN q point;
 ALTER TABLE attmp ADD COLUMN r lseg;
 ALTER TABLE attmp ADD COLUMN s path;
 ALTER TABLE attmp ADD COLUMN t box;
-ALTER TABLE attmp ADD COLUMN u tinterval;
 ALTER TABLE attmp ADD COLUMN v timestamp;
 ALTER TABLE attmp ADD COLUMN w interval;
 ALTER TABLE attmp ADD COLUMN x float8[];
 ALTER TABLE attmp ADD COLUMN y float4[];
 ALTER TABLE attmp ADD COLUMN z int2[];
-INSERT INTO attmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
+INSERT INTO attmp (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 attmp;
- 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 attmp_idx ON attmp (a, (d + e), b);
diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out
index b00ab0f142c..b2b45773339 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 7bcc03b9ada..11e6cd85714 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -521,24 +521,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)
@@ -568,12 +550,9 @@ btint4cmp(integer,integer)
 btfloat4cmp(real,real)
 btfloat8cmp(double precision,double precision)
 btoidcmp(oid,oid)
-btabstimecmp(abstime,abstime)
 btcharcmp("char","char")
 btnamecmp(name,name)
 cash_cmp(money,money)
-btreltimecmp(reltime,reltime)
-bttintervalcmp(tinterval,tinterval)
 int8eq(bigint,bigint)
 int8ne(bigint,bigint)
 int8lt(bigint,bigint)
@@ -593,12 +572,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)
@@ -1074,9 +1047,6 @@ ORDER BY 1, 2;
  !~*  | ~*
  !~~  | ~~
  !~~* | ~~*
- #<   | #>=
- #<=  | #>
- #<>  | #=
  *<   | *>=
  *<=  | *>
  *<>  | *=
@@ -1086,7 +1056,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
@@ -1354,7 +1324,6 @@ WHERE a.aggfnoid = p.oid AND
 
 -- Cross-check transfn against its entry in pg_proc.
 -- NOTE: use physically_coercible here, not binary_coercible, because
--- max and min on abstime are implemented using int4larger/int4smaller.
 SELECT a.aggfnoid::oid, p.proname, ptr.oid, ptr.proname
 FROM pg_aggregate AS a, pg_proc AS p, pg_proc AS ptr
 WHERE a.aggfnoid = p.oid AND
@@ -1535,7 +1504,6 @@ WHERE a.aggfnoid = p.oid AND
 -- Check that all combine functions have signature
 -- combine(transtype, transtype) returns transtype
 -- NOTE: use physically_coercible here, not binary_coercible, because
--- max and min on abstime are implemented using int4larger/int4smaller.
 SELECT a.aggfnoid, p.proname
 FROM pg_aggregate as a, pg_proc as p
 WHERE a.aggcombinefn = p.oid AND
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 078129f251b..735dd37acff 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -1706,7 +1706,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 48e0508a96b..9c7a60c092d 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
@@ -174,7 +173,6 @@ quad_poly_tbl_ord_seq2|f
 radix_text_tbl|t
 ramp|f
 real_city|f
-reltime_tbl|f
 road|t
 shighway|t
 slow_emp4000|f
@@ -205,7 +203,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 7d59de98ebd..5057ad81aa6 100644
--- a/src/test/regress/expected/triggers.out
+++ b/src/test/regress/expected/triggers.out
@@ -285,7 +285,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 16f979c8d93..8f07343c1a9 100644
--- a/src/test/regress/parallel_schedule
+++ b/src/test/regress/parallel_schedule
@@ -23,12 +23,12 @@ 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
 # geometry depends on point, lseg, box, path, polygon and circle
-# horology depends on interval, timetz, timestamp, timestamptz, reltime and abstime
+# horology depends on interval, timetz, timestamp, timestamptz
 # ----------
 test: geometry horology regex oidjoins type_sanity opr_sanity misc_sanity comments expressions
 
diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule
index 42632be6750..265e2cda502 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 b90497804b0..f1b85d5ba77 100644
--- a/src/test/regress/sql/alter_table.sql
+++ b/src/test/regress/sql/alter_table.sql
@@ -35,12 +35,8 @@ ALTER TABLE attmp ADD COLUMN f int2;
 
 ALTER TABLE attmp ADD COLUMN g polygon;
 
-ALTER TABLE attmp ADD COLUMN h abstime;
-
 ALTER TABLE attmp ADD COLUMN i char;
 
-ALTER TABLE attmp ADD COLUMN j abstime[];
-
 ALTER TABLE attmp ADD COLUMN k int4;
 
 ALTER TABLE attmp ADD COLUMN l tid;
@@ -60,8 +56,6 @@ ALTER TABLE attmp ADD COLUMN s path;
 
 ALTER TABLE attmp ADD COLUMN t box;
 
-ALTER TABLE attmp ADD COLUMN u tinterval;
-
 ALTER TABLE attmp ADD COLUMN v timestamp;
 
 ALTER TABLE attmp ADD COLUMN w interval;
@@ -72,13 +66,13 @@ ALTER TABLE attmp ADD COLUMN y float4[];
 
 ALTER TABLE attmp ADD COLUMN z int2[];
 
-INSERT INTO attmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
+INSERT INTO attmp (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 attmp;
@@ -104,12 +98,8 @@ ALTER TABLE attmp ADD COLUMN f int2;
 
 ALTER TABLE attmp ADD COLUMN g polygon;
 
-ALTER TABLE attmp ADD COLUMN h abstime;
-
 ALTER TABLE attmp ADD COLUMN i char;
 
-ALTER TABLE attmp ADD COLUMN j abstime[];
-
 ALTER TABLE attmp ADD COLUMN k int4;
 
 ALTER TABLE attmp ADD COLUMN l tid;
@@ -129,8 +119,6 @@ ALTER TABLE attmp ADD COLUMN s path;
 
 ALTER TABLE attmp ADD COLUMN t box;
 
-ALTER TABLE attmp ADD COLUMN u tinterval;
-
 ALTER TABLE attmp ADD COLUMN v timestamp;
 
 ALTER TABLE attmp ADD COLUMN w interval;
@@ -141,13 +129,13 @@ ALTER TABLE attmp ADD COLUMN y float4[];
 
 ALTER TABLE attmp ADD COLUMN z int2[];
 
-INSERT INTO attmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
+INSERT INTO attmp (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 attmp;
diff --git a/src/test/regress/sql/horology.sql b/src/test/regress/sql/horology.sql
index ca34e8753de..e356dd563ee 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/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql
index a593d376438..5bb365e9da5 100644
--- a/src/test/regress/sql/opr_sanity.sql
+++ b/src/test/regress/sql/opr_sanity.sql
@@ -823,7 +823,6 @@ WHERE a.aggfnoid = p.oid AND
 
 -- Cross-check transfn against its entry in pg_proc.
 -- NOTE: use physically_coercible here, not binary_coercible, because
--- max and min on abstime are implemented using int4larger/int4smaller.
 SELECT a.aggfnoid::oid, p.proname, ptr.oid, ptr.proname
 FROM pg_aggregate AS a, pg_proc AS p, pg_proc AS ptr
 WHERE a.aggfnoid = p.oid AND
@@ -978,7 +977,6 @@ WHERE a.aggfnoid = p.oid AND
 -- Check that all combine functions have signature
 -- combine(transtype, transtype) returns transtype
 -- NOTE: use physically_coercible here, not binary_coercible, because
--- max and min on abstime are implemented using int4larger/int4smaller.
 
 SELECT a.aggfnoid, p.proname
 FROM pg_aggregate as a, pg_proc as p
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 d7dfd753be2..03c8c775dca 100644
--- a/src/test/regress/sql/triggers.sql
+++ b/src/test/regress/sql/triggers.sql
@@ -194,7 +194,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.18.0.rc2.dirty

#38Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#37)
Re: [HACKERS] Something for the TODO list: deprecating abstime and friends

Andres Freund <andres@anarazel.de> writes:

Here's a refreshed version of this patch. First patch removes
contrib/spi/timetravel, second patch removes abstime, reltime, tinterval
together with timeofday().

I'd kind of like to keep timeofday(); it's the only simple way to
get a time display that includes "native" timezone info. For
instance, I get

regression=# select timeofday();
timeofday
-------------------------------------
Sat Sep 29 00:37:35.490977 2018 EDT
(1 row)

I think every other option would show me "-04" not "EDT".

+1 for removing the rest of that, though. Unless somebody is
motivated to recast contrib/spi/timetravel with timestamptz
as the datetime type?

regards, tom lane