diff --git a/src/backend/po/de.po b/src/backend/po/de.po index 0962242..30d589a 100644 --- a/src/backend/po/de.po +++ b/src/backend/po/de.po @@ -20594,11 +20594,6 @@ msgstr "ungültiger Zeitzonenname: »%s«" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "kann »abstime«-Wert »invalid« nicht »timestamp« umwandeln" -#: utils/adt/nabstime.c:782 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "ungültiger Status in externem »tinterval«-Wert" - #: utils/adt/nabstime.c:852 #, c-format msgid "cannot convert reltime \"invalid\" to interval" diff --git a/src/backend/po/es.po b/src/backend/po/es.po index 1e98ded..66be186 100644 --- a/src/backend/po/es.po +++ b/src/backend/po/es.po @@ -21160,11 +21160,6 @@ msgstr "nombre de huso horario no válido: «%s»" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "no se puede convertir el valor reservado de abstime «invalid» a timestamp" -#: utils/adt/nabstime.c:782 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "estatus no válido en valor «tinterval» externo" - #: utils/adt/nabstime.c:852 #, c-format msgid "cannot convert reltime \"invalid\" to interval" @@ -25281,9 +25276,6 @@ msgstr "no se puede importar un snapshot desde una base de datos diferente" #~ msgid "invalid input syntax for type macaddr: \"%s\"" #~ msgstr "sintaxis de entrada no válida para tipo macaddr: «%s»" -#~ msgid "invalid input syntax for type tinterval: \"%s\"" -#~ msgstr "sintaxis de entrada no válida para el tipo tinterval: «%s»" - #~ msgid "invalid input syntax for type numeric: \"%s\"" #~ msgstr "la sintaxis de entrada no es válida para el tipo numeric: «%s»" diff --git a/src/backend/po/fr.po b/src/backend/po/fr.po index c709370..4763830 100644 --- a/src/backend/po/fr.po +++ b/src/backend/po/fr.po @@ -19564,21 +19564,11 @@ msgstr "nom du fuseau horaire invalide : « %s »" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "ne peut pas convertir un abstime « invalid » en timestamp" -#: utils/adt/nabstime.c:781 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "statut invalide dans la valeur externe « tinterval »" - #: utils/adt/nabstime.c:855 #, c-format msgid "cannot convert reltime \"invalid\" to interval" msgstr "ne peut pas convertir reltime « invalid » en interval" -#: utils/adt/nabstime.c:1550 -#, c-format -msgid "invalid input syntax for type tinterval: \"%s\"" -msgstr "syntaxe en entrée invalide pour le type tinterval : « %s »" - #: utils/adt/network.c:69 #, c-format msgid "invalid cidr value: \"%s\"" diff --git a/src/backend/po/id.po b/src/backend/po/id.po index d5d4841..dfdbbc2 100644 --- a/src/backend/po/id.po +++ b/src/backend/po/id.po @@ -15760,21 +15760,11 @@ msgstr "nama zona waktu tidak valid: « %s »" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "tidak dapat mengkonversi abstime « invalid » ke timestamp" -#: utils/adt/nabstime.c:807 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "status tidak valid pada nilai eksternal « tinterval »" - #: utils/adt/nabstime.c:881 #, c-format msgid "cannot convert reltime \"invalid\" to interval" msgstr "tidak dapat mengkonversi reltime « invalid » ke interval" -#: utils/adt/nabstime.c:1576 -#, c-format -msgid "invalid input syntax for type tinterval: \"%s\"" -msgstr "sintaks masukan tidak valid untuk tipe tinterval : « %s »" - #: utils/adt/network.c:118 #, c-format msgid "invalid cidr value: \"%s\"" diff --git a/src/backend/po/it.po b/src/backend/po/it.po index 5f42bb4..21135e6 100644 --- a/src/backend/po/it.po +++ b/src/backend/po/it.po @@ -20609,11 +20609,6 @@ msgstr "il nome del fuso orario \"%s\" non è valido" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "non è possibile convertire il valore abstime \"invalid\" in timestamp" -#: utils/adt/nabstime.c:782 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "lo stato nel valore del \"tinterval\" esterno non è valido" - #: utils/adt/nabstime.c:852 #, c-format msgid "cannot convert reltime \"invalid\" to interval" diff --git a/src/backend/po/ja.po b/src/backend/po/ja.po index 2fa5d48..8bdb383 100644 --- a/src/backend/po/ja.po +++ b/src/backend/po/ja.po @@ -15765,11 +15765,6 @@ msgstr "下限および上限は有限でなければなりません" msgid "lower bound cannot equal upper bound" msgstr "下限を上限と同じにできません" -#: utils/adt/formatting.c:492 -#, c-format -msgid "invalid format specification for an interval value" -msgstr "\"tinterval\"値の書式指定が無効です" - #: utils/adt/formatting.c:493 #, c-format msgid "Intervals are not tied to specific calendar dates." @@ -16510,21 +16505,11 @@ msgstr "時間帯名称が無効です: \"%s\"" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "abstimeの\"invalid\"をtimestampに変換できません" -#: utils/adt/nabstime.c:807 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "\"tinterval\"の外部値のステータスが無効です" - #: utils/adt/nabstime.c:881 #, c-format msgid "cannot convert reltime \"invalid\" to interval" msgstr "reltimeの\"invalid\"をintervalに変換できません" -#: utils/adt/nabstime.c:1576 -#, c-format -msgid "invalid input syntax for type tinterval: \"%s\"" -msgstr "型tintervalの入力構文が無効です: \"%s\"" - #: utils/adt/network.c:118 #, c-format msgid "invalid cidr value: \"%s\"" diff --git a/src/backend/po/ko.po b/src/backend/po/ko.po index c5225ff..9a4e045 100644 --- a/src/backend/po/ko.po +++ b/src/backend/po/ko.po @@ -20131,21 +20131,11 @@ msgstr "잘못된 타임존 이름: \"%s\"" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "\"invalid\" abstime 자료형을 timestamp 자료형으로 변환할 수 없습니다." -#: utils/adt/nabstime.c:781 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "외부 \"tinterval\" 값에 잘못된 상태가 있음" - #: utils/adt/nabstime.c:855 #, c-format msgid "cannot convert reltime \"invalid\" to interval" msgstr "reltime \"invalid\"를 interval로 변환할 수 없음" -#: utils/adt/nabstime.c:1550 -#, c-format -msgid "invalid input syntax for type tinterval: \"%s\"" -msgstr "tinterval 자료형에 대한 잘못된 입력: \"%s\"" - #: utils/adt/network.c:69 #, c-format msgid "invalid cidr value: \"%s\"" diff --git a/src/backend/po/pl.po b/src/backend/po/pl.po index 3ac9d04..2162abf 100644 --- a/src/backend/po/pl.po +++ b/src/backend/po/pl.po @@ -21418,11 +21418,6 @@ msgstr "nieprawidłowa nazwa strefy czasowej: \"%s\"" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "nie można przekształcić abstime \"invalid\" do znacznika czasu" -#: utils/adt/nabstime.c:782 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "niepoprawny status w zewnętrznej wartości \"tinterval\"" - #: utils/adt/nabstime.c:852 #, c-format msgid "cannot convert reltime \"invalid\" to interval" @@ -25688,9 +25683,6 @@ msgstr "nie można importować migawki z innej bazy danych" #~ msgid "invalid input syntax for type numeric: \"%s\"" #~ msgstr "nieprawidłowa składnia wejścia dla typu numerycznego: \"%s\"" -#~ msgid "invalid input syntax for type tinterval: \"%s\"" -#~ msgstr "nieprawidłowa składnia wejścia dla typu tinterval: \"%s\"" - #~ msgid "invalid input syntax for type macaddr: \"%s\"" #~ msgstr "nieprawidłowa składnia wejścia dla typu macaddr: \"%s\"" diff --git a/src/backend/po/pt_BR.po b/src/backend/po/pt_BR.po index 37e4a28..b3ae6fc 100644 --- a/src/backend/po/pt_BR.po +++ b/src/backend/po/pt_BR.po @@ -17283,21 +17283,11 @@ msgstr "nome de zona horária é inválido: \"%s\"" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "não pode converter abstime \"invalid\" para timestamp" -#: utils/adt/nabstime.c:781 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "status é inválido no valor de \"tinterval\" externo" - #: utils/adt/nabstime.c:855 #, c-format msgid "cannot convert reltime \"invalid\" to interval" msgstr "não pode converter reltime \"invalid\" em interval" -#: utils/adt/nabstime.c:1550 -#, c-format -msgid "invalid input syntax for type tinterval: \"%s\"" -msgstr "sintaxe de entrada é inválida para tipo tinterval: \"%s\"" - #: utils/adt/network.c:69 #, c-format msgid "invalid cidr value: \"%s\"" diff --git a/src/backend/po/ru.po b/src/backend/po/ru.po index a4ce728..ca435ee 100644 --- a/src/backend/po/ru.po +++ b/src/backend/po/ru.po @@ -22472,11 +22472,6 @@ msgstr "неверное название часового пояса: \"%s\"" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "преобразовать значение \"invalid\" типа abstime в timestamp нельзя" -#: utils/adt/nabstime.c:782 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "неверное состояние во внешнем представлении \"tinterval\"" - #: utils/adt/nabstime.c:852 #, c-format msgid "cannot convert reltime \"invalid\" to interval" @@ -27722,9 +27717,6 @@ msgstr "Используйте для записи спецсимволов си #~ msgid "invalid input syntax for type macaddr: \"%s\"" #~ msgstr "неверный синтаксис для типа macaddr: \"%s\"" -#~ msgid "invalid input syntax for type tinterval: \"%s\"" -#~ msgstr "неверный синтаксис для типа tinterval: \"%s\"" - #~ msgid "invalid input syntax for type numeric: \"%s\"" #~ msgstr "неверный синтаксис для типа numeric: \"%s\"" diff --git a/src/backend/po/zh_CN.po b/src/backend/po/zh_CN.po index 1e6934a..c5cc4b2 100644 --- a/src/backend/po/zh_CN.po +++ b/src/backend/po/zh_CN.po @@ -20229,21 +20229,11 @@ msgstr "无效时区名字: \"%s\"" msgid "cannot convert abstime \"invalid\" to timestamp" msgstr "无法把 abstime \"invalid\" 转换为 timestamp." -#: utils/adt/nabstime.c:781 -#, c-format -msgid "invalid status in external \"tinterval\" value" -msgstr "无效的外部 \"tinterval\" 值状态" - #: utils/adt/nabstime.c:855 #, c-format msgid "cannot convert reltime \"invalid\" to interval" msgstr "无法把 reltime \"invalid\" 转换为 interval" -#: utils/adt/nabstime.c:1550 -#, c-format -msgid "invalid input syntax for type tinterval: \"%s\"" -msgstr "无效的 tinterval 类型输入语法: \"%s\"" - #: utils/adt/network.c:69 #, c-format msgid "invalid cidr value: \"%s\"" diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c index 2c59480..c6fa81e 100644 --- a/src/backend/utils/adt/nabstime.c +++ b/src/backend/utils/adt/nabstime.c @@ -3,7 +3,6 @@ * nabstime.c * Utilities for the built-in type "AbsoluteTime". * Functions for the built-in type "RelativeTime". - * Functions for the built-in type "TimeInterval". * * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California @@ -36,27 +35,10 @@ * Unix epoch is Jan 1 00:00:00 1970. * Postgres knows about times sixty-eight years on either side of that * for these 4-byte types. - * - * "tinterval" is two 4-byte fields. - * Definitions for parsing tinterval. */ #define IsSpace(C) ((C) == ' ') -#define T_INTERVAL_INVAL 0 /* data represents no valid tinterval */ -#define T_INTERVAL_VALID 1 /* data represents a valid tinterval */ -/* - * ['Mon May 10 23:59:12 1943 PST' 'Sun Jan 14 03:14:21 1973 PST'] - * 0 1 2 3 4 5 6 - * 1234567890123456789012345678901234567890123456789012345678901234 - * - * we allocate some extra -- timezones are usually 3 characters but - * this is not in the POSIX standard... - */ -#define T_INTERVAL_LEN 80 -#define INVALID_INTERVAL_STR "Undefined Range" -#define INVALID_INTERVAL_STR_LEN (sizeof(INVALID_INTERVAL_STR)-1) - #define ABSTIMEMIN(t1, t2) \ (DatumGetBool(DirectFunctionCall2(abstimele, \ AbsoluteTimeGetDatum(t1), \ @@ -73,10 +55,6 @@ static AbsoluteTime tm2abstime(struct pg_tm *tm, int tz); static void reltime2tm(RelativeTime time, struct pg_tm *tm); -static void parsetinterval(char *i_string, - AbsoluteTime *i_start, - AbsoluteTime *i_end); - /* * GetCurrentAbsoluteTime() @@ -693,114 +671,6 @@ reltime2tm(RelativeTime time, struct pg_tm *tm) } -/* - * tintervalin - converts an tinterval string to internal format - */ -Datum -tintervalin(PG_FUNCTION_ARGS) -{ - char *tintervalstr = PG_GETARG_CSTRING(0); - TimeInterval tinterval; - AbsoluteTime i_start, - i_end, - t1, - t2; - - parsetinterval(tintervalstr, &t1, &t2); - - tinterval = (TimeInterval) palloc(sizeof(TimeIntervalData)); - - if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME) - tinterval->status = T_INTERVAL_INVAL; /* undefined */ - else - tinterval->status = T_INTERVAL_VALID; - - i_start = ABSTIMEMIN(t1, t2); - i_end = ABSTIMEMAX(t1, t2); - tinterval->data[0] = i_start; - tinterval->data[1] = i_end; - - PG_RETURN_TIMEINTERVAL(tinterval); -} - - -/* - * tintervalout - converts an internal tinterval format to a string - */ -Datum -tintervalout(PG_FUNCTION_ARGS) -{ - TimeInterval tinterval = PG_GETARG_TIMEINTERVAL(0); - char *i_str, - *p; - - i_str = (char *) palloc(T_INTERVAL_LEN); /* ["..." "..."] */ - strcpy(i_str, "[\""); - if (tinterval->status == T_INTERVAL_INVAL) - strcat(i_str, INVALID_INTERVAL_STR); - else - { - p = DatumGetCString(DirectFunctionCall1(abstimeout, - AbsoluteTimeGetDatum(tinterval->data[0]))); - strcat(i_str, p); - pfree(p); - strcat(i_str, "\" \""); - p = DatumGetCString(DirectFunctionCall1(abstimeout, - AbsoluteTimeGetDatum(tinterval->data[1]))); - strcat(i_str, p); - pfree(p); - } - strcat(i_str, "\"]"); - PG_RETURN_CSTRING(i_str); -} - -/* - * tintervalrecv - converts external binary format to tinterval - */ -Datum -tintervalrecv(PG_FUNCTION_ARGS) -{ - StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); - TimeInterval tinterval; - int32 status; - - tinterval = (TimeInterval) palloc(sizeof(TimeIntervalData)); - - tinterval->status = pq_getmsgint(buf, sizeof(tinterval->status)); - tinterval->data[0] = pq_getmsgint(buf, sizeof(tinterval->data[0])); - tinterval->data[1] = pq_getmsgint(buf, sizeof(tinterval->data[1])); - - if (tinterval->data[0] == INVALID_ABSTIME || - tinterval->data[1] == INVALID_ABSTIME) - status = T_INTERVAL_INVAL; /* undefined */ - else - status = T_INTERVAL_VALID; - - if (status != tinterval->status) - ereport(ERROR, - (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), - errmsg("invalid status in external \"tinterval\" value"))); - - PG_RETURN_TIMEINTERVAL(tinterval); -} - -/* - * tintervalsend - converts tinterval to binary format - */ -Datum -tintervalsend(PG_FUNCTION_ARGS) -{ - TimeInterval tinterval = PG_GETARG_TIMEINTERVAL(0); - StringInfoData buf; - - pq_begintypsend(&buf); - pq_sendint(&buf, tinterval->status, sizeof(tinterval->status)); - pq_sendint(&buf, tinterval->data[0], sizeof(tinterval->data[0])); - pq_sendint(&buf, tinterval->data[1], sizeof(tinterval->data[1])); - PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); -} - - /***************************************************************************** * PUBLIC ROUTINES * *****************************************************************************/ @@ -874,33 +744,6 @@ reltime_interval(PG_FUNCTION_ARGS) /* - * mktinterval - creates a time interval with endpoints t1 and t2 - */ -Datum -mktinterval(PG_FUNCTION_ARGS) -{ - AbsoluteTime t1 = PG_GETARG_ABSOLUTETIME(0); - AbsoluteTime t2 = PG_GETARG_ABSOLUTETIME(1); - AbsoluteTime tstart = ABSTIMEMIN(t1, t2); - AbsoluteTime tend = ABSTIMEMAX(t1, t2); - TimeInterval tinterval; - - tinterval = (TimeInterval) palloc(sizeof(TimeIntervalData)); - - if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME) - tinterval->status = T_INTERVAL_INVAL; - - else - { - tinterval->status = T_INTERVAL_VALID; - tinterval->data[0] = tstart; - tinterval->data[1] = tend; - } - - PG_RETURN_TIMEINTERVAL(tinterval); -} - -/* * timepl, timemi and abstimemi use the formula * abstime + reltime = abstime * so abstime - reltime = abstime @@ -946,49 +789,6 @@ timemi(PG_FUNCTION_ARGS) /* - * intinterval - returns true iff absolute date is in the tinterval - */ -Datum -intinterval(PG_FUNCTION_ARGS) -{ - AbsoluteTime t = PG_GETARG_ABSOLUTETIME(0); - TimeInterval tinterval = PG_GETARG_TIMEINTERVAL(1); - - if (tinterval->status == T_INTERVAL_VALID && t != INVALID_ABSTIME) - { - if (DatumGetBool(DirectFunctionCall2(abstimege, - AbsoluteTimeGetDatum(t), - AbsoluteTimeGetDatum(tinterval->data[0]))) && - DatumGetBool(DirectFunctionCall2(abstimele, - AbsoluteTimeGetDatum(t), - AbsoluteTimeGetDatum(tinterval->data[1])))) - PG_RETURN_BOOL(true); - } - PG_RETURN_BOOL(false); -} - -/* - * tintervalrel - returns relative time corresponding to tinterval - */ -Datum -tintervalrel(PG_FUNCTION_ARGS) -{ - TimeInterval tinterval = PG_GETARG_TIMEINTERVAL(0); - AbsoluteTime t1 = tinterval->data[0]; - AbsoluteTime t2 = tinterval->data[1]; - - if (tinterval->status != T_INTERVAL_VALID) - PG_RETURN_RELATIVETIME(INVALID_RELTIME); - - if (AbsoluteTimeIsReal(t1) && - AbsoluteTimeIsReal(t2)) - PG_RETURN_RELATIVETIME(t2 - t1); - - PG_RETURN_RELATIVETIME(INVALID_RELTIME); -} - - -/* * timenow - returns time "now", internal format * * Now AbsoluteTime is time since Jan 1 1970 -mer 7 Feb 1992 @@ -1092,456 +892,6 @@ btreltimecmp(PG_FUNCTION_ARGS) PG_RETURN_INT32(reltime_cmp_internal(t1, t2)); } - -/* - * tintervalsame - returns true iff tinterval i1 is same as tinterval i2 - * Check begin and end time. - */ -Datum -tintervalsame(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - if (i1->status == T_INTERVAL_INVAL || i2->status == T_INTERVAL_INVAL) - PG_RETURN_BOOL(false); - - if (DatumGetBool(DirectFunctionCall2(abstimeeq, - AbsoluteTimeGetDatum(i1->data[0]), - AbsoluteTimeGetDatum(i2->data[0]))) && - DatumGetBool(DirectFunctionCall2(abstimeeq, - AbsoluteTimeGetDatum(i1->data[1]), - AbsoluteTimeGetDatum(i2->data[1])))) - PG_RETURN_BOOL(true); - PG_RETURN_BOOL(false); -} - -/* - * tinterval comparison routines - * - * Note: comparison is based only on the lengths of the tintervals, not on - * endpoint values (as long as they're not INVALID). This is pretty bogus, - * but since it's only a legacy datatype, we're not going to change it. - * - * Some other bogus things that won't be changed for compatibility reasons: - * 1. The interval length computations overflow at 2^31 seconds, causing - * intervals longer than that to sort oddly compared to those shorter. - * 2. infinity and minus infinity (NOEND_ABSTIME and NOSTART_ABSTIME) are - * just ordinary integers. Since this code doesn't handle them specially, - * it's possible for [a b] to be considered longer than [c infinity] for - * finite abstimes a, b, c. In combination with the previous point, the - * interval [-infinity infinity] is treated as being shorter than many finite - * intervals :-( - * - * If tinterval is ever reimplemented atop timestamp, it'd be good to give - * some consideration to avoiding these problems. - */ -static int -tinterval_cmp_internal(TimeInterval a, TimeInterval b) -{ - bool a_invalid; - bool b_invalid; - AbsoluteTime a_len; - AbsoluteTime b_len; - - /* - * We consider all INVALIDs to be equal and larger than any non-INVALID. - * This is somewhat arbitrary; the important thing is to have a consistent - * sort order. - */ - a_invalid = a->status == T_INTERVAL_INVAL || - a->data[0] == INVALID_ABSTIME || - a->data[1] == INVALID_ABSTIME; - b_invalid = b->status == T_INTERVAL_INVAL || - b->data[0] == INVALID_ABSTIME || - b->data[1] == INVALID_ABSTIME; - - if (a_invalid) - { - if (b_invalid) - return 0; /* INVALID = INVALID */ - else - return 1; /* INVALID > non-INVALID */ - } - - if (b_invalid) - return -1; /* non-INVALID < INVALID */ - - a_len = a->data[1] - a->data[0]; - b_len = b->data[1] - b->data[0]; - - if (a_len > b_len) - return 1; - else if (a_len == b_len) - return 0; - else - return -1; -} - -Datum -tintervaleq(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) == 0); -} - -Datum -tintervalne(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) != 0); -} - -Datum -tintervallt(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) < 0); -} - -Datum -tintervalle(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) <= 0); -} - -Datum -tintervalgt(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) > 0); -} - -Datum -tintervalge(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - PG_RETURN_BOOL(tinterval_cmp_internal(i1, i2) >= 0); -} - -Datum -bttintervalcmp(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - PG_RETURN_INT32(tinterval_cmp_internal(i1, i2)); -} - - -/* - * tintervalleneq - returns true iff length of tinterval i is equal to - * reltime t - * tintervallenne - returns true iff length of tinterval i is not equal - * to reltime t - * tintervallenlt - returns true iff length of tinterval i is less than - * reltime t - * tintervallengt - returns true iff length of tinterval i is greater - * than reltime t - * tintervallenle - returns true iff length of tinterval i is less or - * equal than reltime t - * tintervallenge - returns true iff length of tinterval i is greater or - * equal than reltime t - */ -Datum -tintervalleneq(PG_FUNCTION_ARGS) -{ - TimeInterval i = PG_GETARG_TIMEINTERVAL(0); - RelativeTime t = PG_GETARG_RELATIVETIME(1); - RelativeTime rt; - - if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME) - PG_RETURN_BOOL(false); - rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel, - TimeIntervalGetDatum(i))); - PG_RETURN_BOOL(rt != INVALID_RELTIME && rt == t); -} - -Datum -tintervallenne(PG_FUNCTION_ARGS) -{ - TimeInterval i = PG_GETARG_TIMEINTERVAL(0); - RelativeTime t = PG_GETARG_RELATIVETIME(1); - RelativeTime rt; - - if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME) - PG_RETURN_BOOL(false); - rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel, - TimeIntervalGetDatum(i))); - PG_RETURN_BOOL(rt != INVALID_RELTIME && rt != t); -} - -Datum -tintervallenlt(PG_FUNCTION_ARGS) -{ - TimeInterval i = PG_GETARG_TIMEINTERVAL(0); - RelativeTime t = PG_GETARG_RELATIVETIME(1); - RelativeTime rt; - - if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME) - PG_RETURN_BOOL(false); - rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel, - TimeIntervalGetDatum(i))); - PG_RETURN_BOOL(rt != INVALID_RELTIME && rt < t); -} - -Datum -tintervallengt(PG_FUNCTION_ARGS) -{ - TimeInterval i = PG_GETARG_TIMEINTERVAL(0); - RelativeTime t = PG_GETARG_RELATIVETIME(1); - RelativeTime rt; - - if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME) - PG_RETURN_BOOL(false); - rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel, - TimeIntervalGetDatum(i))); - PG_RETURN_BOOL(rt != INVALID_RELTIME && rt > t); -} - -Datum -tintervallenle(PG_FUNCTION_ARGS) -{ - TimeInterval i = PG_GETARG_TIMEINTERVAL(0); - RelativeTime t = PG_GETARG_RELATIVETIME(1); - RelativeTime rt; - - if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME) - PG_RETURN_BOOL(false); - rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel, - TimeIntervalGetDatum(i))); - PG_RETURN_BOOL(rt != INVALID_RELTIME && rt <= t); -} - -Datum -tintervallenge(PG_FUNCTION_ARGS) -{ - TimeInterval i = PG_GETARG_TIMEINTERVAL(0); - RelativeTime t = PG_GETARG_RELATIVETIME(1); - RelativeTime rt; - - if (i->status == T_INTERVAL_INVAL || t == INVALID_RELTIME) - PG_RETURN_BOOL(false); - rt = DatumGetRelativeTime(DirectFunctionCall1(tintervalrel, - TimeIntervalGetDatum(i))); - PG_RETURN_BOOL(rt != INVALID_RELTIME && rt >= t); -} - -/* - * tintervalct - returns true iff tinterval i1 contains tinterval i2 - */ -Datum -tintervalct(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - if (i1->status == T_INTERVAL_INVAL || i2->status == T_INTERVAL_INVAL) - PG_RETURN_BOOL(false); - if (DatumGetBool(DirectFunctionCall2(abstimele, - AbsoluteTimeGetDatum(i1->data[0]), - AbsoluteTimeGetDatum(i2->data[0]))) && - DatumGetBool(DirectFunctionCall2(abstimege, - AbsoluteTimeGetDatum(i1->data[1]), - AbsoluteTimeGetDatum(i2->data[1])))) - PG_RETURN_BOOL(true); - PG_RETURN_BOOL(false); -} - -/* - * tintervalov - returns true iff tinterval i1 (partially) overlaps i2 - */ -Datum -tintervalov(PG_FUNCTION_ARGS) -{ - TimeInterval i1 = PG_GETARG_TIMEINTERVAL(0); - TimeInterval i2 = PG_GETARG_TIMEINTERVAL(1); - - if (i1->status == T_INTERVAL_INVAL || i2->status == T_INTERVAL_INVAL) - PG_RETURN_BOOL(false); - if (DatumGetBool(DirectFunctionCall2(abstimelt, - AbsoluteTimeGetDatum(i1->data[1]), - AbsoluteTimeGetDatum(i2->data[0]))) || - DatumGetBool(DirectFunctionCall2(abstimegt, - AbsoluteTimeGetDatum(i1->data[0]), - AbsoluteTimeGetDatum(i2->data[1])))) - PG_RETURN_BOOL(false); - PG_RETURN_BOOL(true); -} - -/* - * tintervalstart - returns the start of tinterval i - */ -Datum -tintervalstart(PG_FUNCTION_ARGS) -{ - TimeInterval i = PG_GETARG_TIMEINTERVAL(0); - - if (i->status == T_INTERVAL_INVAL) - PG_RETURN_ABSOLUTETIME(INVALID_ABSTIME); - PG_RETURN_ABSOLUTETIME(i->data[0]); -} - -/* - * tintervalend - returns the end of tinterval i - */ -Datum -tintervalend(PG_FUNCTION_ARGS) -{ - TimeInterval i = PG_GETARG_TIMEINTERVAL(0); - - if (i->status == T_INTERVAL_INVAL) - PG_RETURN_ABSOLUTETIME(INVALID_ABSTIME); - PG_RETURN_ABSOLUTETIME(i->data[1]); -} - - -/***************************************************************************** - * PRIVATE ROUTINES * - *****************************************************************************/ - -/* - * parsetinterval -- parse a tinterval string - * - * output parameters: - * i_start, i_end: tinterval margins - * - * Time interval: - * `[' {` '} `'' `'' {` '} `'' `'' {` '} `]' - * - * OR `Undefined Range' (see also INVALID_INTERVAL_STR) - * - * where satisfies the syntax of absolute time. - * - * e.g. [ ' Jan 18 1902' 'Jan 1 00:00:00 1970'] - */ -static void -parsetinterval(char *i_string, - AbsoluteTime *i_start, - AbsoluteTime *i_end) -{ - char *p, - *p1; - char c; - - p = i_string; - /* skip leading blanks up to '[' */ - while ((c = *p) != '\0') - { - if (IsSpace(c)) - p++; - else if (c != '[') - goto bogus; /* syntax error */ - else - break; - } - if (c == '\0') - goto bogus; /* syntax error */ - p++; - /* skip leading blanks up to '"' */ - while ((c = *p) != '\0') - { - if (IsSpace(c)) - p++; - else if (c != '"') - goto bogus; /* syntax error */ - else - break; - } - if (c == '\0') - goto bogus; /* syntax error */ - p++; - if (strncmp(INVALID_INTERVAL_STR, p, strlen(INVALID_INTERVAL_STR)) == 0) - goto bogus; /* undefined range, handled like a syntax err. */ - /* search for the end of the first date and change it to a \0 */ - p1 = p; - while ((c = *p1) != '\0') - { - if (c == '"') - break; - p1++; - } - if (c == '\0') - goto bogus; /* syntax error */ - *p1 = '\0'; - /* get the first date */ - *i_start = DatumGetAbsoluteTime(DirectFunctionCall1(abstimein, - CStringGetDatum(p))); - /* undo change to \0 */ - *p1 = c; - p = ++p1; - /* skip blanks up to '"', beginning of second date */ - while ((c = *p) != '\0') - { - if (IsSpace(c)) - p++; - else if (c != '"') - goto bogus; /* syntax error */ - else - break; - } - if (c == '\0') - goto bogus; /* syntax error */ - p++; - /* search for the end of the second date and change it to a \0 */ - p1 = p; - while ((c = *p1) != '\0') - { - if (c == '"') - break; - p1++; - } - if (c == '\0') - goto bogus; /* syntax error */ - *p1 = '\0'; - /* get the second date */ - *i_end = DatumGetAbsoluteTime(DirectFunctionCall1(abstimein, - CStringGetDatum(p))); - /* undo change to \0 */ - *p1 = c; - p = ++p1; - /* skip blanks up to ']' */ - while ((c = *p) != '\0') - { - if (IsSpace(c)) - p++; - else if (c != ']') - goto bogus; /* syntax error */ - else - break; - } - if (c == '\0') - goto bogus; /* syntax error */ - p++; - c = *p; - if (c != '\0') - goto bogus; /* syntax error */ - - /* it seems to be a valid tinterval */ - return; - -bogus: - ereport(ERROR, - (errcode(ERRCODE_INVALID_DATETIME_FORMAT), - errmsg("invalid input syntax for type %s: \"%s\"", - "tinterval", i_string))); - *i_start = *i_end = INVALID_ABSTIME; /* keep compiler quiet */ -} - - /***************************************************************************** * *****************************************************************************/ diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index e103f5e..b28f428 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -3946,7 +3946,6 @@ convert_to_scalar(Datum value, Oid valuetypid, double *scaledvalue, case DATEOID: case INTERVALOID: case RELTIMEOID: - case TINTERVALOID: case TIMEOID: case TIMETZOID: *scaledvalue = convert_timevalue_to_scalar(value, valuetypid); @@ -4379,14 +4378,6 @@ convert_timevalue_to_scalar(Datum value, Oid typid) } case RELTIMEOID: return (DatumGetRelativeTime(value) * 1000000.0); - case TINTERVALOID: - { - TimeInterval tinterval = DatumGetTimeInterval(value); - - if (tinterval->status != 0) - return ((tinterval->data[1] - tinterval->data[0]) * 1000000.0); - return 0; /* for lack of a better idea */ - } case TIMEOID: return DatumGetTimeADT(value); case TIMETZOID: diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h index f850be4..6fc2f08 100644 --- a/src/include/catalog/pg_amop.h +++ b/src/include/catalog/pg_amop.h @@ -473,16 +473,6 @@ DATA(insert ( 2233 703 703 4 s 571 403 0 )); DATA(insert ( 2233 703 703 5 s 569 403 0 )); /* - * btree tinterval_ops - */ - -DATA(insert ( 2234 704 704 1 s 813 403 0 )); -DATA(insert ( 2234 704 704 2 s 815 403 0 )); -DATA(insert ( 2234 704 704 3 s 811 403 0 )); -DATA(insert ( 2234 704 704 4 s 816 403 0 )); -DATA(insert ( 2234 704 704 5 s 814 403 0 )); - -/* * btree array_ops */ diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h index 7d245b1..cca4d63 100644 --- a/src/include/catalog/pg_amproc.h +++ b/src/include/catalog/pg_amproc.h @@ -136,7 +136,6 @@ DATA(insert ( 2097 1042 1042 1 2180 )); DATA(insert ( 2097 1042 1042 2 3333 )); DATA(insert ( 2099 790 790 1 377 )); DATA(insert ( 2233 703 703 1 380 )); -DATA(insert ( 2234 704 704 1 381 )); DATA(insert ( 2789 27 27 1 2794 )); DATA(insert ( 2968 2950 2950 1 2960 )); DATA(insert ( 2968 2950 2950 2 3300 )); diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h index 28dbc74..8212304 100644 --- a/src/include/catalog/pg_opclass.h +++ b/src/include/catalog/pg_opclass.h @@ -179,7 +179,6 @@ DATA(insert ( 405 text_pattern_ops PGNSP PGUID 2229 25 f 0 )); DATA(insert ( 405 varchar_pattern_ops PGNSP PGUID 2229 25 f 0 )); DATA(insert ( 405 bpchar_pattern_ops PGNSP PGUID 2231 1042 f 0 )); DATA(insert ( 403 reltime_ops PGNSP PGUID 2233 703 t 0 )); -DATA(insert ( 403 tinterval_ops PGNSP PGUID 2234 704 t 0 )); DATA(insert ( 405 aclitem_ops PGNSP PGUID 2235 1033 t 0 )); DATA(insert ( 783 box_ops PGNSP PGUID 2593 603 t 0 )); DATA(insert ( 783 point_ops PGNSP PGUID 1029 600 t 603 )); diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h index ffabc20..d79f5f2 100644 --- a/src/include/catalog/pg_operator.h +++ b/src/include/catalog/pg_operator.h @@ -373,30 +373,10 @@ DATA(insert OID = 570 ( "<=" PGNSP PGUID b f f 703 703 16 571 569 reltimele DESCR("less than or equal"); DATA(insert OID = 571 ( ">=" PGNSP PGUID b f f 703 703 16 570 568 reltimege scalargtsel scalargtjoinsel )); DESCR("greater than or equal"); -DATA(insert OID = 572 ( "~=" PGNSP PGUID b f f 704 704 16 572 0 tintervalsame eqsel eqjoinsel )); -DESCR("same as"); -DATA(insert OID = 573 ( "<<" PGNSP PGUID b f f 704 704 16 0 0 tintervalct - - )); -DESCR("contains"); -DATA(insert OID = 574 ( "&&" PGNSP PGUID b f f 704 704 16 574 0 tintervalov - - )); -DESCR("overlaps"); -DATA(insert OID = 575 ( "#=" PGNSP PGUID b f f 704 703 16 0 576 tintervalleneq - - )); -DESCR("equal by length"); -DATA(insert OID = 576 ( "#<>" PGNSP PGUID b f f 704 703 16 0 575 tintervallenne - - )); -DESCR("not equal by length"); -DATA(insert OID = 577 ( "#<" PGNSP PGUID b f f 704 703 16 0 580 tintervallenlt - - )); -DESCR("less than by length"); -DATA(insert OID = 578 ( "#>" PGNSP PGUID b f f 704 703 16 0 579 tintervallengt - - )); -DESCR("greater than by length"); -DATA(insert OID = 579 ( "#<=" PGNSP PGUID b f f 704 703 16 0 578 tintervallenle - - )); -DESCR("less than or equal by length"); -DATA(insert OID = 580 ( "#>=" PGNSP PGUID b f f 704 703 16 0 577 tintervallenge - - )); -DESCR("greater than or equal by length"); DATA(insert OID = 581 ( "+" PGNSP PGUID b f f 702 703 702 0 0 timepl - - )); DESCR("add"); DATA(insert OID = 582 ( "-" PGNSP PGUID b f f 702 703 702 0 0 timemi - - )); DESCR("subtract"); -DATA(insert OID = 583 ( "" PGNSP PGUID b f f 702 704 16 0 0 intinterval - - )); -DESCR("is contained by"); DATA(insert OID = 584 ( "-" PGNSP PGUID l f f 0 700 700 0 0 float4um - - )); DESCR("negate"); DATA(insert OID = 585 ( "-" PGNSP PGUID l f f 0 701 701 0 0 float8um - - )); @@ -425,10 +405,6 @@ DATA(insert OID = 596 ( "|/" PGNSP PGUID l f f 0 701 701 0 0 dsqrt - - )) DESCR("square root"); DATA(insert OID = 597 ( "||/" PGNSP PGUID l f f 0 701 701 0 0 dcbrt - - )); DESCR("cube root"); -DATA(insert OID = 1284 ( "|" PGNSP PGUID l f f 0 704 702 0 0 tintervalstart - - )); -DESCR("start of interval"); -DATA(insert OID = 606 ( "<#>" PGNSP PGUID b f f 702 702 704 0 0 mktinterval - - )); -DESCR("convert to tinterval"); DATA(insert OID = 607 ( "=" PGNSP PGUID b t t 26 26 16 607 608 oideq eqsel eqjoinsel )); DESCR("equal"); @@ -669,19 +645,6 @@ DESCR("horizontally aligned"); DATA(insert OID = 809 ( "?|" PGNSP PGUID b f f 600 600 16 809 0 point_vert - - )); DESCR("vertically aligned"); -DATA(insert OID = 811 ( "=" PGNSP PGUID b t f 704 704 16 811 812 tintervaleq eqsel eqjoinsel )); -DESCR("equal"); -DATA(insert OID = 812 ( "<>" PGNSP PGUID b f f 704 704 16 812 811 tintervalne neqsel neqjoinsel )); -DESCR("not equal"); -DATA(insert OID = 813 ( "<" PGNSP PGUID b f f 704 704 16 814 816 tintervallt scalarltsel scalarltjoinsel )); -DESCR("less than"); -DATA(insert OID = 814 ( ">" PGNSP PGUID b f f 704 704 16 813 815 tintervalgt scalargtsel scalargtjoinsel )); -DESCR("greater than"); -DATA(insert OID = 815 ( "<=" PGNSP PGUID b f f 704 704 16 816 814 tintervalle scalarltsel scalarltjoinsel )); -DESCR("less than or equal"); -DATA(insert OID = 816 ( ">=" PGNSP PGUID b f f 704 704 16 815 813 tintervalge scalargtsel scalargtjoinsel )); -DESCR("greater than or equal"); - DATA(insert OID = 843 ( "*" PGNSP PGUID b f f 790 700 790 845 0 cash_mul_flt4 - - )); DESCR("multiply"); DATA(insert OID = 844 ( "/" PGNSP PGUID b f f 790 700 790 0 0 cash_div_flt4 - - )); diff --git a/src/include/catalog/pg_opfamily.h b/src/include/catalog/pg_opfamily.h index 0d0ba7c..b13590a 100644 --- a/src/include/catalog/pg_opfamily.h +++ b/src/include/catalog/pg_opfamily.h @@ -127,7 +127,6 @@ DATA(insert OID = 2228 ( 405 reltime_ops PGNSP PGUID )); DATA(insert OID = 2229 ( 405 text_pattern_ops PGNSP PGUID )); DATA(insert OID = 2231 ( 405 bpchar_pattern_ops PGNSP PGUID )); DATA(insert OID = 2233 ( 403 reltime_ops PGNSP PGUID )); -DATA(insert OID = 2234 ( 403 tinterval_ops PGNSP PGUID )); DATA(insert OID = 2235 ( 405 aclitem_ops PGNSP PGUID )); DATA(insert OID = 2593 ( 783 box_ops PGNSP PGUID )); DATA(insert OID = 2594 ( 783 poly_ops PGNSP PGUID )); diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 8b33b4e..c002766 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -450,13 +450,6 @@ DATA(insert OID = 243 ( reltimeout PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 DESCR("I/O"); DATA(insert OID = 244 ( timepl PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 702 "702 703" _null_ _null_ _null_ _null_ _null_ timepl _null_ _null_ _null_ )); DATA(insert OID = 245 ( timemi PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 702 "702 703" _null_ _null_ _null_ _null_ _null_ timemi _null_ _null_ _null_ )); -DATA(insert OID = 246 ( tintervalin PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 704 "2275" _null_ _null_ _null_ _null_ _null_ tintervalin _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 247 ( tintervalout PGNSP PGUID 12 1 0 0 0 f f f f t f s s 1 0 2275 "704" _null_ _null_ _null_ _null_ _null_ tintervalout _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 248 ( intinterval PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "702 704" _null_ _null_ _null_ _null_ _null_ intinterval _null_ _null_ _null_ )); -DATA(insert OID = 249 ( tintervalrel PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 703 "704" _null_ _null_ _null_ _null_ _null_ tintervalrel _null_ _null_ _null_ )); -DESCR("tinterval to reltime"); DATA(insert OID = 250 ( timenow PGNSP PGUID 12 1 0 0 0 f f f f t f s s 0 0 702 "" _null_ _null_ _null_ _null_ _null_ timenow _null_ _null_ _null_ )); DESCR("current date and time (abstime)"); DATA(insert OID = 251 ( abstimeeq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "702 702" _null_ _null_ _null_ _null_ _null_ abstimeeq _null_ _null_ _null_ )); @@ -471,18 +464,6 @@ DATA(insert OID = 259 ( reltimelt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 DATA(insert OID = 260 ( reltimegt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "703 703" _null_ _null_ _null_ _null_ _null_ reltimegt _null_ _null_ _null_ )); DATA(insert OID = 261 ( reltimele PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "703 703" _null_ _null_ _null_ _null_ _null_ reltimele _null_ _null_ _null_ )); DATA(insert OID = 262 ( reltimege PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "703 703" _null_ _null_ _null_ _null_ _null_ reltimege _null_ _null_ _null_ )); -DATA(insert OID = 263 ( tintervalsame PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalsame _null_ _null_ _null_ )); -DATA(insert OID = 264 ( tintervalct PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalct _null_ _null_ _null_ )); -DATA(insert OID = 265 ( tintervalov PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalov _null_ _null_ _null_ )); -DATA(insert OID = 266 ( tintervalleneq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervalleneq _null_ _null_ _null_ )); -DATA(insert OID = 267 ( tintervallenne PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallenne _null_ _null_ _null_ )); -DATA(insert OID = 268 ( tintervallenlt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallenlt _null_ _null_ _null_ )); -DATA(insert OID = 269 ( tintervallengt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallengt _null_ _null_ _null_ )); -DATA(insert OID = 270 ( tintervallenle PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallenle _null_ _null_ _null_ )); -DATA(insert OID = 271 ( tintervallenge PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 703" _null_ _null_ _null_ _null_ _null_ tintervallenge _null_ _null_ _null_ )); -DATA(insert OID = 272 ( tintervalstart PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 702 "704" _null_ _null_ _null_ _null_ _null_ tintervalstart _null_ _null_ _null_ )); -DATA(insert OID = 273 ( tintervalend PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 702 "704" _null_ _null_ _null_ _null_ _null_ tintervalend _null_ _null_ _null_ )); -DESCR("end of interval"); DATA(insert OID = 274 ( timeofday PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 25 "" _null_ _null_ _null_ _null_ _null_ timeofday _null_ _null_ _null_ )); DESCR("current date and time - increments during transactions"); DATA(insert OID = 275 ( isfinite PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 16 "702" _null_ _null_ _null_ _null_ _null_ abstime_finite _null_ _null_ _null_ )); @@ -634,8 +615,6 @@ DATA(insert OID = 377 ( cash_cmp PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 DESCR("less-equal-greater"); DATA(insert OID = 380 ( btreltimecmp PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "703 703" _null_ _null_ _null_ _null_ _null_ btreltimecmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); -DATA(insert OID = 381 ( bttintervalcmp PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "704 704" _null_ _null_ _null_ _null_ _null_ bttintervalcmp _null_ _null_ _null_ )); -DESCR("less-equal-greater"); DATA(insert OID = 382 ( btarraycmp PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 23 "2277 2277" _null_ _null_ _null_ _null_ _null_ btarraycmp _null_ _null_ _null_ )); DESCR("less-equal-greater"); @@ -771,8 +750,6 @@ DESCR("transform a varchar length coercion"); DATA(insert OID = 669 ( varchar PGNSP PGUID 12 1 0 0 varchar_transform f f f f t f i s 3 0 1043 "1043 23 16" _null_ _null_ _null_ _null_ _null_ varchar _null_ _null_ _null_ )); DESCR("adjust varchar() to typmod length"); -DATA(insert OID = 676 ( mktinterval PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 704 "702 702" _null_ _null_ _null_ _null_ _null_ mktinterval _null_ _null_ _null_ )); - DATA(insert OID = 619 ( oidvectorne PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "30 30" _null_ _null_ _null_ _null_ _null_ oidvectorne _null_ _null_ _null_ )); DATA(insert OID = 677 ( oidvectorlt PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "30 30" _null_ _null_ _null_ _null_ _null_ oidvectorlt _null_ _null_ _null_ )); DATA(insert OID = 678 ( oidvectorle PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 16 "30 30" _null_ _null_ _null_ _null_ _null_ oidvectorle _null_ _null_ _null_ )); @@ -927,13 +904,6 @@ DESCR("larger of two"); DATA(insert OID = 771 ( int2smaller PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 21 "21 21" _null_ _null_ _null_ _null_ _null_ int2smaller _null_ _null_ _null_ )); DESCR("smaller of two"); -DATA(insert OID = 784 ( tintervaleq PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervaleq _null_ _null_ _null_ )); -DATA(insert OID = 785 ( tintervalne PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalne _null_ _null_ _null_ )); -DATA(insert OID = 786 ( tintervallt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervallt _null_ _null_ _null_ )); -DATA(insert OID = 787 ( tintervalgt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalgt _null_ _null_ _null_ )); -DATA(insert OID = 788 ( tintervalle PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalle _null_ _null_ _null_ )); -DATA(insert OID = 789 ( tintervalge PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "704 704" _null_ _null_ _null_ _null_ _null_ tintervalge _null_ _null_ _null_ )); - /* OIDS 800 - 899 */ DATA(insert OID = 846 ( cash_mul_flt4 PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 790 "790 700" _null_ _null_ _null_ _null_ _null_ cash_mul_flt4 _null_ _null_ _null_ )); @@ -1689,8 +1659,6 @@ DATA(insert OID = 1479 ( circle PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 71 DESCR("convert box to circle"); DATA(insert OID = 1480 ( box PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 603 "718" _null_ _null_ _null_ _null_ _null_ circle_box _null_ _null_ _null_ )); DESCR("convert circle to box"); -DATA(insert OID = 1481 ( tinterval PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 704 "702 702" _null_ _null_ _null_ _null_ _null_ mktinterval _null_ _null_ _null_ )); -DESCR("convert to tinterval"); DATA(insert OID = 1482 ( lseg_ne PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "601 601" _null_ _null_ _null_ _null_ _null_ lseg_ne _null_ _null_ _null_ )); DATA(insert OID = 1483 ( lseg_lt PGNSP PGUID 12 1 0 0 0 f f f t t f i s 2 0 16 "601 601" _null_ _null_ _null_ _null_ _null_ lseg_lt _null_ _null_ _null_ )); @@ -4042,10 +4010,6 @@ DATA(insert OID = 2464 ( reltimerecv PGNSP PGUID 12 1 0 0 0 f f f f t f i s DESCR("I/O"); DATA(insert OID = 2465 ( reltimesend PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "703" _null_ _null_ _null_ _null_ _null_ reltimesend _null_ _null_ _null_ )); DESCR("I/O"); -DATA(insert OID = 2466 ( tintervalrecv PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 704 "2281" _null_ _null_ _null_ _null_ _null_ tintervalrecv _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 2467 ( tintervalsend PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "704" _null_ _null_ _null_ _null_ _null_ tintervalsend _null_ _null_ _null_ )); -DESCR("I/O"); DATA(insert OID = 2468 ( date_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 1082 "2281" _null_ _null_ _null_ _null_ _null_ date_recv _null_ _null_ _null_ )); DESCR("I/O"); DATA(insert OID = 2469 ( date_send PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "1082" _null_ _null_ _null_ _null_ _null_ date_send _null_ _null_ _null_ )); diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index ffdb452..aab23cb 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -423,9 +423,6 @@ DESCR("absolute, limited-range date and time (Unix system time)"); DATA(insert OID = 703 ( reltime PGNSP PGUID 4 t b T f t \054 0 0 1024 reltimein reltimeout reltimerecv reltimesend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("relative, limited-range time interval (Unix delta time)"); #define RELTIMEOID 703 -DATA(insert OID = 704 ( tinterval PGNSP PGUID 12 f b T f t \054 0 0 1025 tintervalin tintervalout tintervalrecv tintervalsend - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); -DESCR("(abstime,abstime), time interval"); -#define TINTERVALOID 704 DATA(insert OID = 705 ( unknown PGNSP PGUID -2 f p X f t \054 0 0 0 unknownin unknownout unknownrecv unknownsend - - - c p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR(""); #define UNKNOWNOID 705 @@ -486,7 +483,6 @@ DATA(insert OID = 1021 ( _float4 PGNSP PGUID -1 f b A f t \054 0 700 0 array_i DATA(insert OID = 1022 ( _float8 PGNSP PGUID -1 f b A f t \054 0 701 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1023 ( _abstime PGNSP PGUID -1 f b A f t \054 0 702 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1024 ( _reltime PGNSP PGUID -1 f b A f t \054 0 703 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); -DATA(insert OID = 1025 ( _tinterval PGNSP PGUID -1 f b A f t \054 0 704 0 array_in array_out array_recv array_send - - array_typanalyze i x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1027 ( _polygon PGNSP PGUID -1 f b A f t \054 0 604 0 array_in array_out array_recv array_send - - array_typanalyze d x f 0 -1 0 0 _null_ _null_ _null_ )); DATA(insert OID = 1033 ( aclitem PGNSP PGUID 12 f b U f t \054 0 0 1034 aclitemin aclitemout - - - - - i p f 0 -1 0 0 _null_ _null_ _null_ )); DESCR("access control list"); diff --git a/src/include/utils/nabstime.h b/src/include/utils/nabstime.h index 6913395..3f54ff4 100644 --- a/src/include/utils/nabstime.h +++ b/src/include/utils/nabstime.h @@ -36,32 +36,20 @@ typedef int32 AbsoluteTime; typedef int32 RelativeTime; -typedef struct -{ - int32 status; - AbsoluteTime data[2]; -} TimeIntervalData; - -typedef TimeIntervalData *TimeInterval; - /* * Macros for fmgr-callable functions. */ #define DatumGetAbsoluteTime(X) ((AbsoluteTime) DatumGetInt32(X)) #define DatumGetRelativeTime(X) ((RelativeTime) DatumGetInt32(X)) -#define DatumGetTimeInterval(X) ((TimeInterval) DatumGetPointer(X)) #define AbsoluteTimeGetDatum(X) Int32GetDatum(X) #define RelativeTimeGetDatum(X) Int32GetDatum(X) -#define TimeIntervalGetDatum(X) PointerGetDatum(X) #define PG_GETARG_ABSOLUTETIME(n) DatumGetAbsoluteTime(PG_GETARG_DATUM(n)) #define PG_GETARG_RELATIVETIME(n) DatumGetRelativeTime(PG_GETARG_DATUM(n)) -#define PG_GETARG_TIMEINTERVAL(n) DatumGetTimeInterval(PG_GETARG_DATUM(n)) #define PG_RETURN_ABSOLUTETIME(x) return AbsoluteTimeGetDatum(x) #define PG_RETURN_RELATIVETIME(x) return RelativeTimeGetDatum(x) -#define PG_RETURN_TIMEINTERVAL(x) return TimeIntervalGetDatum(x) /* * Reserved values diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 03c55d3..7e24687 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -227,8 +227,6 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia return (ECPG_ARRAY_ERROR); if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), RELTIMEOID, ECPG_ARRAY_NONE, stmt->lineno)) return (ECPG_ARRAY_ERROR); - if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), TINTERVALOID, ECPG_ARRAY_NONE, stmt->lineno)) - return (ECPG_ARRAY_ERROR); if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), UNKNOWNOID, ECPG_ARRAY_NONE, stmt->lineno)) return (ECPG_ARRAY_ERROR); if (!ecpg_type_infocache_push(&(stmt->connection->cache_head), CIRCLEOID, ECPG_ARRAY_NONE, stmt->lineno)) diff --git a/src/interfaces/ecpg/ecpglib/pg_type.h b/src/interfaces/ecpg/ecpglib/pg_type.h index 94d2d92..e6d4843 100644 --- a/src/interfaces/ecpg/ecpglib/pg_type.h +++ b/src/interfaces/ecpg/ecpglib/pg_type.h @@ -40,7 +40,6 @@ #define FLOAT8OID 701 #define ABSTIMEOID 702 #define RELTIMEOID 703 -#define TINTERVALOID 704 #define UNKNOWNOID 705 #define CIRCLEOID 718 #define CASHOID 790 diff --git a/src/test/regress/expected/abstime.out b/src/test/regress/expected/abstime.out index ed48f64..91614da 100644 --- a/src/test/regress/expected/abstime.out +++ b/src/test/regress/expected/abstime.out @@ -1,7 +1,7 @@ -- -- ABSTIME -- testing built-in time type abstime --- uses reltime and tinterval +-- uses reltime -- -- -- timezones may vary based not only on location but the operating @@ -109,16 +109,6 @@ SELECT '' AS four, * FROM ABSTIME_TBL | Sat May 10 23:59:12 1947 PST (4 rows) -SELECT '' AS four, * FROM ABSTIME_TBL - WHERE ABSTIME_TBL.f1 - tinterval '["Apr 1 1950 00:00:00" "Dec 30 1999 23:00:00"]'; - four | f1 -------+------------------------------ - | Sun Jan 14 03:14:21 1973 PST - | Mon May 01 00:30:30 1995 PDT - | Wed Dec 31 16:00:00 1969 PST -(3 rows) - SELECT '' AS four, f1 AS abstime, date_part('year', f1) AS year, date_part('month', f1) AS month, date_part('day',f1) AS day, date_part('hour', f1) AS hour, diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out index 13d6a4b..64bf68b 100644 --- a/src/test/regress/expected/alter_table.out +++ b/src/test/regress/expected/alter_table.out @@ -29,7 +29,7 @@ ALTER TABLE tmp ADD COLUMN q point; ALTER TABLE tmp ADD COLUMN r lseg; ALTER TABLE tmp ADD COLUMN s path; ALTER TABLE tmp ADD COLUMN t box; -ALTER TABLE tmp ADD COLUMN u tinterval; +ALTER TABLE tmp ADD COLUMN u inet; ALTER TABLE tmp ADD COLUMN v timestamp; ALTER TABLE tmp ADD COLUMN w interval; ALTER TABLE tmp ADD COLUMN x float8[]; @@ -41,12 +41,12 @@ INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u, 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}', 314159, '(1,1)', '512', '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)', - '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["epoch" "infinity"]', + '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '192.168.1.1', 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); SELECT * FROM tmp; - initial | a | b | c | d | e | f | g | h | i | j | k | l | m | n | p | q | r | s | t | u | v | w | x | y | z ----------+---+------+------+-----+-----+---+-----------------------+------------------------------+---+------------------------------------------------------------------------------------------------+--------+-------+-----+-----------------+---------------+-----------+-----------------------+-----------------------------+---------------------+---------------------------------------------+--------------------------+------------------+-----------+-----------+----------- - | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | Mon May 01 00:30:30 1995 PDT | c | {"Mon May 01 00:30:30 1995 PDT","Mon Aug 24 14:43:07 1992 PDT","Wed Dec 31 16:00:00 1969 PST"} | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | magnetic disk | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | ["Wed Dec 31 16:00:00 1969 PST" "infinity"] | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4} + initial | a | b | c | d | e | f | g | h | i | j | k | l | m | n | p | q | r | s | t | u | v | w | x | y | z +---------+---+------+------+-----+-----+---+-----------------------+------------------------------+---+------------------------------------------------------------------------------------------------+--------+-------+-----+-----------------+---------------+-----------+-----------------------+-----------------------------+---------------------+-------------+--------------------------+------------------+-----------+-----------+----------- + | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | Mon May 01 00:30:30 1995 PDT | c | {"Mon May 01 00:30:30 1995 PDT","Mon Aug 24 14:43:07 1992 PDT","Wed Dec 31 16:00:00 1969 PST"} | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | magnetic disk | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | 192.168.1.1 | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4} (1 row) DROP TABLE tmp; @@ -74,7 +74,7 @@ ALTER TABLE tmp ADD COLUMN q point; ALTER TABLE tmp ADD COLUMN r lseg; ALTER TABLE tmp ADD COLUMN s path; ALTER TABLE tmp ADD COLUMN t box; -ALTER TABLE tmp ADD COLUMN u tinterval; +ALTER TABLE tmp ADD COLUMN u inet; ALTER TABLE tmp ADD COLUMN v timestamp; ALTER TABLE tmp ADD COLUMN w interval; ALTER TABLE tmp ADD COLUMN x float8[]; @@ -86,12 +86,12 @@ INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u, 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}', 314159, '(1,1)', '512', '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)', - '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["epoch" "infinity"]', + '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '192.168.1.1', 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); SELECT * FROM tmp; - initial | a | b | c | d | e | f | g | h | i | j | k | l | m | n | p | q | r | s | t | u | v | w | x | y | z ----------+---+------+------+-----+-----+---+-----------------------+------------------------------+---+------------------------------------------------------------------------------------------------+--------+-------+-----+-----------------+---------------+-----------+-----------------------+-----------------------------+---------------------+---------------------------------------------+--------------------------+------------------+-----------+-----------+----------- - | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | Mon May 01 00:30:30 1995 PDT | c | {"Mon May 01 00:30:30 1995 PDT","Mon Aug 24 14:43:07 1992 PDT","Wed Dec 31 16:00:00 1969 PST"} | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | magnetic disk | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | ["Wed Dec 31 16:00:00 1969 PST" "infinity"] | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4} + initial | a | b | c | d | e | f | g | h | i | j | k | l | m | n | p | q | r | s | t | u | v | w | x | y | z +---------+---+------+------+-----+-----+---+-----------------------+------------------------------+---+------------------------------------------------------------------------------------------------+--------+-------+-----+-----------------+---------------+-----------+-----------------------+-----------------------------+---------------------+-------------+--------------------------+------------------+-----------+-----------+----------- + | 4 | name | text | 4.1 | 4.1 | 2 | ((4.1,4.1),(3.1,3.1)) | Mon May 01 00:30:30 1995 PDT | c | {"Mon May 01 00:30:30 1995 PDT","Mon Aug 24 14:43:07 1992 PDT","Wed Dec 31 16:00:00 1969 PST"} | 314159 | (1,1) | 512 | 1 2 3 4 5 6 7 8 | magnetic disk | (1.1,1.1) | [(4.1,4.1),(3.1,3.1)] | ((0,2),(4.1,4.1),(3.1,3.1)) | (4.1,4.1),(3.1,3.1) | 192.168.1.1 | Thu Jan 01 00:00:00 1970 | @ 1 hour 10 secs | {1,2,3,4} | {1,2,3,4} | {1,2,3,4} (1 row) DROP TABLE tmp; diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out index fcf8bd7..56a4b26 100644 --- a/src/test/regress/expected/opr_sanity.out +++ b/src/test/regress/expected/opr_sanity.out @@ -532,12 +532,6 @@ reltimelt(reltime,reltime) reltimegt(reltime,reltime) reltimele(reltime,reltime) reltimege(reltime,reltime) -tintervalleneq(tinterval,reltime) -tintervallenne(tinterval,reltime) -tintervallenlt(tinterval,reltime) -tintervallengt(tinterval,reltime) -tintervallenle(tinterval,reltime) -tintervallenge(tinterval,reltime) float4eq(real,real) float4ne(real,real) float4lt(real,real) @@ -581,12 +575,6 @@ namege(name,name) namene(name,name) oidlt(oid,oid) oidle(oid,oid) -tintervaleq(tinterval,tinterval) -tintervalne(tinterval,tinterval) -tintervallt(tinterval,tinterval) -tintervalgt(tinterval,tinterval) -tintervalle(tinterval,tinterval) -tintervalge(tinterval,tinterval) macaddr_eq(macaddr,macaddr) macaddr_lt(macaddr,macaddr) macaddr_le(macaddr,macaddr) @@ -1031,9 +1019,6 @@ ORDER BY 1, 2; !~* | ~* !~~ | ~~ !~~* | ~~* - #< | #>= - #<= | #> - #<> | #= *< | *>= *<= | *> *<> | *= @@ -1043,7 +1028,7 @@ ORDER BY 1, 2; <> | ~= ~<=~ | ~>~ ~<~ | ~>=~ -(16 rows) +(13 rows) -- A mergejoinable or hashjoinable operator must be binary, must return -- boolean, and must have a commutator (itself, unless it's a cross-type diff --git a/src/test/regress/expected/sanity_check.out b/src/test/regress/expected/sanity_check.out index 6750152..7840c4c 100644 --- a/src/test/regress/expected/sanity_check.out +++ b/src/test/regress/expected/sanity_check.out @@ -190,7 +190,6 @@ time_tbl|f timestamp_tbl|f timestamptz_tbl|f timetz_tbl|f -tinterval_tbl|f varchar_tbl|f -- restore normal output mode \a\t diff --git a/src/test/regress/expected/tinterval.out b/src/test/regress/expected/tinterval.out deleted file mode 100644 index a018972..0000000 --- a/src/test/regress/expected/tinterval.out +++ /dev/null @@ -1,172 +0,0 @@ --- --- TINTERVAL --- -CREATE TABLE TINTERVAL_TBL (f1 tinterval); --- Should accept any abstime, --- so do not bother with extensive testing of values -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["-infinity" "infinity"]'); -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]'); -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]'); -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["epoch" "Mon May 1 00:30:30 1995"]'); -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["Feb 15 1990 12:15:03" "2001-09-23 11:12:13"]'); --- badly formatted tintervals -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["bad time specifications" ""]'); -ERROR: invalid input syntax for type abstime: "bad time specifications" -LINE 2: VALUES ('["bad time specifications" ""]'); - ^ -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["" "infinity"]'); -ERROR: invalid input syntax for type abstime: "" -LINE 2: VALUES ('["" "infinity"]'); - ^ --- test tinterval operators -SELECT '' AS five, * FROM TINTERVAL_TBL; - five | f1 -------+----------------------------------------------------------------- - | ["-infinity" "infinity"] - | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] - | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] - | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] -(5 rows) - --- length == -SELECT '' AS one, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #= '@ 1 months'; - one | f1 ------+----------------------------------------------------------------- - | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] -(1 row) - --- length <> -SELECT '' AS three, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #<> '@ 1 months'; - three | f1 --------+----------------------------------------------------------------- - | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] - | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] -(3 rows) - --- length < -SELECT '' AS zero, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #< '@ 1 month'; - zero | f1 -------+---- -(0 rows) - --- length <= -SELECT '' AS one, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #<= '@ 1 month'; - one | f1 ------+----------------------------------------------------------------- - | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] -(1 row) - --- length > -SELECT '' AS three, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #> '@ 1 year'; - three | f1 --------+----------------------------------------------------------------- - | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] - | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] -(3 rows) - --- length >= -SELECT '' AS three, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #>= '@ 3 years'; - three | f1 --------+----------------------------------------------------------------- - | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] - | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] -(3 rows) - --- overlaps -SELECT '' AS three, t1.* - FROM TINTERVAL_TBL t1 - WHERE t1.f1 && - tinterval '["Aug 15 14:23:19 1983" "Sep 16 14:23:19 1983"]'; - three | f1 --------+----------------------------------------------------------------- - | ["-infinity" "infinity"] - | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] -(3 rows) - -SELECT '' AS five, t1.f1, t2.f1 - FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2 - WHERE t1.f1 && t2.f1 and - t1.f1 = t2.f1 - ORDER BY t1.f1, t2.f1; - five | f1 | f1 -------+-----------------------------------------------------------------+----------------------------------------------------------------- - | ["-infinity" "infinity"] | ["-infinity" "infinity"] - | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] - | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] - | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] -(5 rows) - -SELECT '' AS fourteen, t1.f1 AS interval1, t2.f1 AS interval2 - FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2 - WHERE t1.f1 && t2.f1 and not t1.f1 = t2.f1 - ORDER BY interval1, interval2; - fourteen | interval1 | interval2 -----------+-----------------------------------------------------------------+----------------------------------------------------------------- - | ["-infinity" "infinity"] | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] - | ["-infinity" "infinity"] | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] - | ["-infinity" "infinity"] | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] - | ["-infinity" "infinity"] | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] - | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] | ["-infinity" "infinity"] - | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] - | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] | ["-infinity" "infinity"] - | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["-infinity" "infinity"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] - | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] | ["-infinity" "infinity"] - | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] -(14 rows) - --- contains -SELECT '' AS five, t1.f1 - FROM TINTERVAL_TBL t1 - WHERE not t1.f1 << - tinterval '["Aug 15 14:23:19 1980" "Sep 16 14:23:19 1990"]' - ORDER BY t1.f1; - five | f1 -------+----------------------------------------------------------------- - | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] - | ["Thu Feb 15 12:15:03 1990 PST" "Sun Sep 23 11:12:13 2001 PDT"] - | ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] -(3 rows) - --- make time interval -SELECT '' AS three, t1.f1 - FROM TINTERVAL_TBL t1 - WHERE t1.f1 && - (abstime 'Aug 15 14:23:19 1983' <#> - abstime 'Sep 16 14:23:19 1983') - ORDER BY t1.f1; - three | f1 --------+----------------------------------------------------------------- - | ["-infinity" "infinity"] - | ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] - | ["Wed Dec 31 16:00:00 1969 PST" "Mon May 01 00:30:30 1995 PDT"] -(3 rows) - diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index eefdeea..c5f9ffe 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -23,7 +23,7 @@ test: numerology # ---------- # The second group of parallel tests # ---------- -test: point lseg line box path polygon circle date time timetz timestamp timestamptz interval abstime reltime tinterval inet macaddr macaddr8 tstypes +test: point lseg line box path polygon circle date time timetz timestamp timestamptz interval abstime reltime inet macaddr macaddr8 tstypes # ---------- # Another group of parallel tests diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule index 76b0de3..83ba380 100644 --- a/src/test/regress/serial_schedule +++ b/src/test/regress/serial_schedule @@ -38,7 +38,6 @@ test: timestamptz test: interval test: abstime test: reltime -test: tinterval test: inet test: macaddr test: macaddr8 diff --git a/src/test/regress/sql/abstime.sql b/src/test/regress/sql/abstime.sql index 4ab821b..650d7fd 100644 --- a/src/test/regress/sql/abstime.sql +++ b/src/test/regress/sql/abstime.sql @@ -1,7 +1,7 @@ -- -- ABSTIME -- testing built-in time type abstime --- uses reltime and tinterval +-- uses reltime -- -- @@ -54,10 +54,6 @@ SELECT '' AS three, * FROM ABSTIME_TBL SELECT '' AS four, * FROM ABSTIME_TBL WHERE ABSTIME_TBL.f1 <= abstime 'Jan 14, 1973 03:14:21'; -SELECT '' AS four, * FROM ABSTIME_TBL - WHERE ABSTIME_TBL.f1 - tinterval '["Apr 1 1950 00:00:00" "Dec 30 1999 23:00:00"]'; - SELECT '' AS four, f1 AS abstime, date_part('year', f1) AS year, date_part('month', f1) AS month, date_part('day',f1) AS day, date_part('hour', f1) AS hour, diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql index 5dd1402..361ca51 100644 --- a/src/test/regress/sql/alter_table.sql +++ b/src/test/regress/sql/alter_table.sql @@ -50,7 +50,7 @@ ALTER TABLE tmp ADD COLUMN s path; ALTER TABLE tmp ADD COLUMN t box; -ALTER TABLE tmp ADD COLUMN u tinterval; +ALTER TABLE tmp ADD COLUMN u inet; ALTER TABLE tmp ADD COLUMN v timestamp; @@ -68,7 +68,7 @@ INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u, 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}', 314159, '(1,1)', '512', '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)', - '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["epoch" "infinity"]', + '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '192.168.1.1', 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); SELECT * FROM tmp; @@ -119,7 +119,7 @@ ALTER TABLE tmp ADD COLUMN s path; ALTER TABLE tmp ADD COLUMN t box; -ALTER TABLE tmp ADD COLUMN u tinterval; +ALTER TABLE tmp ADD COLUMN u inet; ALTER TABLE tmp ADD COLUMN v timestamp; @@ -137,7 +137,7 @@ INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u, 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}', 314159, '(1,1)', '512', '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)', - '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["epoch" "infinity"]', + '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '192.168.1.1', 'epoch', '01:00:10', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); SELECT * FROM tmp; diff --git a/src/test/regress/sql/tinterval.sql b/src/test/regress/sql/tinterval.sql deleted file mode 100644 index 42399ce..0000000 --- a/src/test/regress/sql/tinterval.sql +++ /dev/null @@ -1,97 +0,0 @@ --- --- TINTERVAL --- - -CREATE TABLE TINTERVAL_TBL (f1 tinterval); - --- Should accept any abstime, --- so do not bother with extensive testing of values - -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["-infinity" "infinity"]'); - -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]'); - -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]'); - -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["epoch" "Mon May 1 00:30:30 1995"]'); - -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["Feb 15 1990 12:15:03" "2001-09-23 11:12:13"]'); - - --- badly formatted tintervals -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["bad time specifications" ""]'); - -INSERT INTO TINTERVAL_TBL (f1) - VALUES ('["" "infinity"]'); - --- test tinterval operators - -SELECT '' AS five, * FROM TINTERVAL_TBL; - --- length == -SELECT '' AS one, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #= '@ 1 months'; - --- length <> -SELECT '' AS three, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #<> '@ 1 months'; - --- length < -SELECT '' AS zero, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #< '@ 1 month'; - --- length <= -SELECT '' AS one, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #<= '@ 1 month'; - --- length > -SELECT '' AS three, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #> '@ 1 year'; - --- length >= -SELECT '' AS three, t.* - FROM TINTERVAL_TBL t - WHERE t.f1 #>= '@ 3 years'; - --- overlaps -SELECT '' AS three, t1.* - FROM TINTERVAL_TBL t1 - WHERE t1.f1 && - tinterval '["Aug 15 14:23:19 1983" "Sep 16 14:23:19 1983"]'; - -SELECT '' AS five, t1.f1, t2.f1 - FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2 - WHERE t1.f1 && t2.f1 and - t1.f1 = t2.f1 - ORDER BY t1.f1, t2.f1; - -SELECT '' AS fourteen, t1.f1 AS interval1, t2.f1 AS interval2 - FROM TINTERVAL_TBL t1, TINTERVAL_TBL t2 - WHERE t1.f1 && t2.f1 and not t1.f1 = t2.f1 - ORDER BY interval1, interval2; - --- contains -SELECT '' AS five, t1.f1 - FROM TINTERVAL_TBL t1 - WHERE not t1.f1 << - tinterval '["Aug 15 14:23:19 1980" "Sep 16 14:23:19 1990"]' - ORDER BY t1.f1; - --- make time interval -SELECT '' AS three, t1.f1 - FROM TINTERVAL_TBL t1 - WHERE t1.f1 && - (abstime 'Aug 15 14:23:19 1983' <#> - abstime 'Sep 16 14:23:19 1983') - ORDER BY t1.f1; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index 23a4bbd..cd26dc2 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -2222,8 +2222,6 @@ TidPath TidScan TidScanState TimeADT -TimeInterval -TimeIntervalData TimeLineHistoryCmd TimeLineHistoryEntry TimeLineID