Remove deprecated abstime, reltime, tinterval datatypes.

These types have been deprecated for a *long* time.

Catversion bump, for obvious reasons.

Author: Andres Freund
Discussion:
    https://postgr.es/m/20181009192237.34wjp3nmw7oynmmr@alap3.anarazel.de
    https://postgr.es/m/20171213080506.cwjkpcz3bkk6yz2u@alap3.anarazel.de
    https://postgr.es/m/25615.1513115237@sss.pgh.pa.us
This commit is contained in:
Andres Freund 2018-09-28 15:21:48 -07:00
parent 2d10defa77
commit cda6a8d01d
41 changed files with 29 additions and 3318 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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 ||

View File

@ -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)

View File

@ -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 \

View File

@ -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
*****************************************************************************/

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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:

View File

@ -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, "

View File

@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 201810091
#define CATALOG_VERSION_NO 201810111
#endif

View File

@ -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' },

View File

@ -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',

View File

@ -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',

View File

@ -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' },

View File

@ -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' },

View File

@ -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)',

View File

@ -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',

View File

@ -673,115 +673,10 @@
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 +937,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 +955,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 +1287,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 +1571,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',
@ -2333,9 +2196,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' },
@ -2353,18 +2213,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',
@ -2385,9 +2236,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' },
@ -2786,11 +2634,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' },
@ -2828,14 +2671,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',
@ -3132,9 +2967,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',
@ -5642,9 +5474,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' },
@ -5660,9 +5489,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' },
@ -6218,9 +6044,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' },
@ -6285,9 +6108,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' },
@ -7462,24 +7282,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' },

View File

@ -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',

View File

@ -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

View File

@ -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 */

View File

@ -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))

View File

@ -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)

View File

@ -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);

View File

@ -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()

View File

@ -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

View File

@ -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)

View File

@ -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))))

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -36,9 +36,6 @@ test: timetz
test: timestamp
test: timestamptz
test: interval
test: abstime
test: reltime
test: tinterval
test: inet
test: macaddr
test: macaddr8

View File

@ -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;

View File

@ -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;

View File

@ -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;
--

View File

@ -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

View File

@ -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;

View File

@ -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;