Commit 64568100 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Implement column aliases on views "CREATE VIEW name (collist)".

Implement TIME WITH TIME ZONE type (timetz internal type).
Remap length() for character strings to CHAR_LENGTH() for SQL92
 and to remove the ambiguity with geometric length() functions.
Keep length() for character strings for backward compatibility.
Shrink stored views by removing internal column name list from visible rte.
Implement min(), max() for time and timetz data types.
Implement conversion of TIME to INTERVAL.
Implement abs(), mod(), fac() for the int8 data type.
Rename some math functions to generic names:
 round(), sqrt(), cbrt(), pow(), etc.
Rename NUMERIC power() function to pow().
Fix int2 factorial to calculate result in int4.
Enhance the Oracle compatibility function translate() to work with string
 arguments (from Edwin Ramirez).
Modify pg_proc system table to remove OID holes.
parent ce543b21
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.122 2000/02/18 09:28:40 inoue Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.123 2000/03/14 23:06:06 thomas Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -1719,8 +1719,10 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, char *adbin, ...@@ -1719,8 +1719,10 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, char *adbin,
*/ */
rte = makeNode(RangeTblEntry); rte = makeNode(RangeTblEntry);
rte->relname = RelationGetRelationName(rel); rte->relname = RelationGetRelationName(rel);
#ifndef DISABLE_EREF
rte->ref = makeNode(Attr); rte->ref = makeNode(Attr);
rte->ref->relname = RelationGetRelationName(rel); rte->ref->relname = RelationGetRelationName(rel);
#endif
rte->relid = RelationGetRelid(rel); rte->relid = RelationGetRelid(rel);
rte->inh = false; rte->inh = false;
rte->inFromCl = true; rte->inFromCl = true;
...@@ -1799,8 +1801,10 @@ StoreRelCheck(Relation rel, char *ccname, char *ccbin) ...@@ -1799,8 +1801,10 @@ StoreRelCheck(Relation rel, char *ccname, char *ccbin)
*/ */
rte = makeNode(RangeTblEntry); rte = makeNode(RangeTblEntry);
rte->relname = RelationGetRelationName(rel); rte->relname = RelationGetRelationName(rel);
#ifndef DISABLE_EREF
rte->ref = makeNode(Attr); rte->ref = makeNode(Attr);
rte->ref->relname = RelationGetRelationName(rel); rte->ref->relname = RelationGetRelationName(rel);
#endif
rte->relid = RelationGetRelid(rel); rte->relid = RelationGetRelid(rel);
rte->inh = false; rte->inh = false;
rte->inFromCl = true; rte->inFromCl = true;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994-5, Regents of the University of California * Portions Copyright (c) 1994-5, Regents of the University of California
* *
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.54 2000/02/15 20:49:08 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.55 2000/03/14 23:06:12 thomas Exp $
* *
*/ */
...@@ -232,9 +232,33 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) ...@@ -232,9 +232,33 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
appendStringInfo(str, " on %s", appendStringInfo(str, " on %s",
stringStringInfo(rte->relname)); stringStringInfo(rte->relname));
if (rte->ref && strcmp(rte->ref->relname, rte->relname) != 0) if (rte->ref != NULL)
{
if ((strcmp(rte->ref->relname, rte->relname) != 0)
|| (length(rte->ref->attrs) > 0))
{
appendStringInfo(str, " %s", appendStringInfo(str, " %s",
stringStringInfo(rte->ref->relname)); stringStringInfo(rte->ref->relname));
if (length(rte->ref->attrs) > 0)
{
List *c;
int firstEntry = true;
appendStringInfo(str, " (");
foreach (c, rte->ref->attrs)
{
if (! firstEntry)
{
appendStringInfo(str, ", ");
firstEntry = false;
}
appendStringInfo(str, "%s", strVal(lfirst(c)));
}
appendStringInfo(str, ")");
}
}
}
} }
break; break;
default: default:
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.108 2000/02/21 18:47:00 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.109 2000/03/14 23:06:27 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1366,6 +1366,7 @@ _copyRangeTblEntry(RangeTblEntry *from) ...@@ -1366,6 +1366,7 @@ _copyRangeTblEntry(RangeTblEntry *from)
if (from->relname) if (from->relname)
newnode->relname = pstrdup(from->relname); newnode->relname = pstrdup(from->relname);
Node_Copy(from, newnode, ref); Node_Copy(from, newnode, ref);
Node_Copy(from, newnode, eref);
newnode->relid = from->relid; newnode->relid = from->relid;
newnode->inh = from->inh; newnode->inh = from->inh;
newnode->inFromCl = from->inFromCl; newnode->inFromCl = from->inFromCl;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.38 2000/02/21 18:47:00 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.39 2000/03/14 23:06:28 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1031,6 +1031,7 @@ _freeRangeTblEntry(RangeTblEntry *node) ...@@ -1031,6 +1031,7 @@ _freeRangeTblEntry(RangeTblEntry *node)
if (node->relname) if (node->relname)
pfree(node->relname); pfree(node->relname);
freeObject(node->ref); freeObject(node->ref);
freeObject(node->eref);
pfree(node); pfree(node);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.45 2000/02/15 20:49:19 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.46 2000/03/14 23:06:29 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -454,8 +454,8 @@ new_rangetable_entry(Oid new_relid, RangeTblEntry *old_entry) ...@@ -454,8 +454,8 @@ new_rangetable_entry(Oid new_relid, RangeTblEntry *old_entry)
RangeTblEntry *new_entry = copyObject(old_entry); RangeTblEntry *new_entry = copyObject(old_entry);
/* ??? someone tell me what the following is doing! - ay 11/94 */ /* ??? someone tell me what the following is doing! - ay 11/94 */
if (!strcmp(new_entry->ref->relname, "*CURRENT*") || if (!strcmp(new_entry->eref->relname, "*CURRENT*") ||
!strcmp(new_entry->ref->relname, "*NEW*")) !strcmp(new_entry->eref->relname, "*NEW*"))
new_entry->ref->relname = get_rel_name(new_relid); new_entry->ref->relname = get_rel_name(new_relid);
else else
new_entry->relname = get_rel_name(new_relid); new_entry->relname = get_rel_name(new_relid);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: analyze.c,v 1.139 2000/03/01 05:18:20 tgl Exp $ * $Id: analyze.c,v 1.140 2000/03/14 23:06:30 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -146,6 +146,34 @@ transformStmt(ParseState *pstate, Node *parseTree) ...@@ -146,6 +146,34 @@ transformStmt(ParseState *pstate, Node *parseTree)
ViewStmt *n = (ViewStmt *) parseTree; ViewStmt *n = (ViewStmt *) parseTree;
n->query = (Query *) transformStmt(pstate, (Node *) n->query); n->query = (Query *) transformStmt(pstate, (Node *) n->query);
/* If a list of column names was given, run through and insert these
* into the actual query tree. - thomas 2000-03-08
*/
if (n->aliases != NIL)
{
int i;
List *targetList = n->query->targetList;
if (length(targetList) < length(n->aliases))
elog(ERROR, "CREATE VIEW specifies %d columns"
" but only %d columns are present",
length(targetList), length(n->aliases));
for (i = 0; i < length(n->aliases); i++)
{
Ident *id;
TargetEntry *te;
Resdom *rd;
id = nth(i, n->aliases);
Assert(nodeTag(id) == T_Ident);
te = nth(i, targetList);
Assert(nodeTag(te) == T_TargetEntry);
rd = te->resdom;
Assert(nodeTag(rd) == T_Resdom);
rd->resname = pstrdup(id->name);
}
}
result = makeNode(Query); result = makeNode(Query);
result->commandType = CMD_UTILITY; result->commandType = CMD_UTILITY;
result->utilityStmt = (Node *) n; result->utilityStmt = (Node *) n;
...@@ -1904,7 +1932,7 @@ transformForUpdate(Query *qry, List *forUpdate) ...@@ -1904,7 +1932,7 @@ transformForUpdate(Query *qry, List *forUpdate)
i = 1; i = 1;
foreach(l2, qry->rtable) foreach(l2, qry->rtable)
{ {
if (strcmp(((RangeTblEntry *) lfirst(l2))->ref->relname, relname) == 0) if (strcmp(((RangeTblEntry *) lfirst(l2))->eref->relname, relname) == 0)
{ {
List *l3; List *l3;
...@@ -1925,7 +1953,7 @@ transformForUpdate(Query *qry, List *forUpdate) ...@@ -1925,7 +1953,7 @@ transformForUpdate(Query *qry, List *forUpdate)
i++; i++;
} }
if (l2 == NULL) if (l2 == NULL)
elog(ERROR, "FOR UPDATE: relation %s not found in FROM clause", elog(ERROR, "FOR UPDATE: relation '%s' not found in FROM clause",
relname); relname);
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.155 2000/03/12 20:09:41 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.156 2000/03/14 23:06:31 thomas Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -307,7 +307,7 @@ static void doNegateFloat(Value *v); ...@@ -307,7 +307,7 @@ static void doNegateFloat(Value *v);
ISOLATION, JOIN, KEY, LANGUAGE, LEADING, LEFT, LEVEL, LIKE, LOCAL, ISOLATION, JOIN, KEY, LANGUAGE, LEADING, LEFT, LEVEL, LIKE, LOCAL,
MATCH, MINUTE_P, MONTH_P, NAMES, MATCH, MINUTE_P, MONTH_P, NAMES,
NATIONAL, NATURAL, NCHAR, NEXT, NO, NOT, NULLIF, NULL_P, NUMERIC, NATIONAL, NATURAL, NCHAR, NEXT, NO, NOT, NULLIF, NULL_P, NUMERIC,
OF, ON, ONLY, OPTION, OR, ORDER, OUTER_P, OF, ON, ONLY, OPTION, OR, ORDER, OUTER_P, OVERLAPS,
PARTIAL, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, PUBLIC, PARTIAL, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, PUBLIC,
READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK, READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK,
SCROLL, SECOND_P, SELECT, SESSION_USER, SET, SUBSTRING, SCROLL, SECOND_P, SELECT, SESSION_USER, SET, SUBSTRING,
...@@ -363,6 +363,7 @@ static void doNegateFloat(Value *v); ...@@ -363,6 +363,7 @@ static void doNegateFloat(Value *v);
%right '=' %right '='
%nonassoc '<' '>' %nonassoc '<' '>'
%nonassoc LIKE %nonassoc LIKE
%nonassoc OVERLAPS
%nonassoc BETWEEN %nonassoc BETWEEN
%nonassoc IN %nonassoc IN
%left Op /* multi-character ops and user-defined operators */ %left Op /* multi-character ops and user-defined operators */
...@@ -2659,11 +2660,12 @@ opt_trans: WORK { $$ = TRUE; } ...@@ -2659,11 +2660,12 @@ opt_trans: WORK { $$ = TRUE; }
* *
*****************************************************************************/ *****************************************************************************/
ViewStmt: CREATE VIEW name AS SelectStmt ViewStmt: CREATE VIEW name opt_column_list AS SelectStmt
{ {
ViewStmt *n = makeNode(ViewStmt); ViewStmt *n = makeNode(ViewStmt);
n->viewname = $3; n->viewname = $3;
n->query = (Query *)$5; n->aliases = $4;
n->query = (Query *)$6;
if (((SelectStmt *)n->query)->sortClause != NULL) if (((SelectStmt *)n->query)->sortClause != NULL)
elog(ERROR,"ORDER BY and DISTINCT on views are not implemented"); elog(ERROR,"ORDER BY and DISTINCT on views are not implemented");
if (((SelectStmt *)n->query)->unionClause != NULL) if (((SelectStmt *)n->query)->unionClause != NULL)
...@@ -2737,7 +2739,7 @@ createdb_opt_encoding: ...@@ -2737,7 +2739,7 @@ createdb_opt_encoding:
int i; int i;
i = pg_char_to_encoding($3); i = pg_char_to_encoding($3);
if (i == -1) if (i == -1)
elog(ERROR, "%s is not a valid encoding name.", $3); elog(ERROR, "%s is not a valid encoding name", $3);
$$ = i; $$ = i;
#else #else
elog(ERROR, "Multi-byte support is not enabled"); elog(ERROR, "Multi-byte support is not enabled");
...@@ -2747,7 +2749,7 @@ createdb_opt_encoding: ...@@ -2747,7 +2749,7 @@ createdb_opt_encoding:
{ {
#ifdef MULTIBYTE #ifdef MULTIBYTE
if (!pg_get_encent_by_encoding($3)) if (!pg_get_encent_by_encoding($3))
elog(ERROR, "%d is not a valid encoding code.", $3); elog(ERROR, "%d is not a valid encoding code", $3);
$$ = $3; $$ = $3;
#else #else
elog(ERROR, "Multi-byte support is not enabled"); elog(ERROR, "Multi-byte support is not enabled");
...@@ -3979,9 +3981,12 @@ Datetime: datetime ...@@ -3979,9 +3981,12 @@ Datetime: datetime
$$->timezone = $2; $$->timezone = $2;
$$->typmod = -1; $$->typmod = -1;
} }
| TIME | TIME opt_timezone
{ {
$$ = makeNode(TypeName); $$ = makeNode(TypeName);
if ($2)
$$->name = xlateSqlType("timetz");
else
$$->name = xlateSqlType("time"); $$->name = xlateSqlType("time");
$$->typmod = -1; $$->typmod = -1;
} }
...@@ -4077,6 +4082,27 @@ row_expr: '(' row_descriptor ')' IN '(' SubSelect ')' ...@@ -4077,6 +4082,27 @@ row_expr: '(' row_descriptor ')' IN '(' SubSelect ')'
{ {
$$ = makeRowExpr($4, $2, $6); $$ = makeRowExpr($4, $2, $6);
} }
| '(' row_descriptor ')' OVERLAPS '(' row_descriptor ')'
{
FuncCall *n = makeNode(FuncCall);
List *largs = $2;
List *rargs = $6;
n->funcname = xlateSqlFunc("overlaps");
if (length(largs) == 1)
largs = lappend(largs, $2);
else if (length(largs) != 2)
elog(ERROR, "Wrong number of parameters"
" on left side of OVERLAPS expression");
if (length(rargs) == 1)
rargs = lappend(rargs, $6);
else if (length(rargs) != 2)
elog(ERROR, "Wrong number of parameters"
" on right side of OVERLAPS expression");
n->args = nconc(largs, rargs);
n->agg_star = false;
n->agg_distinct = false;
$$ = (Node *)n;
}
; ;
row_descriptor: row_list ',' a_expr row_descriptor: row_list ',' a_expr
...@@ -4579,7 +4605,8 @@ c_expr: attr ...@@ -4579,7 +4605,8 @@ c_expr: attr
n->agg_distinct = false; n->agg_distinct = false;
if ($3 != 0) if ($3 != 0)
elog(NOTICE,"CURRENT_TIME(%d) precision not implemented; zero used instead",$3); elog(NOTICE,"CURRENT_TIME(%d) precision not implemented"
"; zero used instead",$3);
$$ = (Node *)n; $$ = (Node *)n;
} }
...@@ -4632,7 +4659,8 @@ c_expr: attr ...@@ -4632,7 +4659,8 @@ c_expr: attr
n->agg_distinct = false; n->agg_distinct = false;
if ($3 != 0) if ($3 != 0)
elog(NOTICE,"CURRENT_TIMESTAMP(%d) precision not implemented; zero used instead",$3); elog(NOTICE,"CURRENT_TIMESTAMP(%d) precision not implemented"
"; zero used instead",$3);
$$ = (Node *)n; $$ = (Node *)n;
} }
...@@ -5219,6 +5247,7 @@ ColId: IDENT { $$ = $1; } ...@@ -5219,6 +5247,7 @@ ColId: IDENT { $$ = $1; }
| ONLY { $$ = "only"; } | ONLY { $$ = "only"; }
| OPERATOR { $$ = "operator"; } | OPERATOR { $$ = "operator"; }
| OPTION { $$ = "option"; } | OPTION { $$ = "option"; }
| OVERLAPS { $$ = "overlaps"; }
| PASSWORD { $$ = "password"; } | PASSWORD { $$ = "password"; }
| PENDANT { $$ = "pendant"; } | PENDANT { $$ = "pendant"; }
| PRIOR { $$ = "prior"; } | PRIOR { $$ = "prior"; }
...@@ -5454,9 +5483,8 @@ mapTargetColumns(List *src, List *dst) ...@@ -5454,9 +5483,8 @@ mapTargetColumns(List *src, List *dst)
static char * static char *
xlateSqlFunc(char *name) xlateSqlFunc(char *name)
{ {
if (!strcasecmp(name,"character_length") if (!strcasecmp(name,"character_length"))
|| !strcasecmp(name,"char_length")) return "char_length";
return "length";
else else
return name; return name;
} /* xlateSqlFunc() */ } /* xlateSqlFunc() */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.67 2000/02/18 09:29:40 inoue Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.68 2000/03/14 23:06:32 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -184,6 +184,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -184,6 +184,7 @@ static ScanKeyword ScanKeywords[] = {
{"or", OR}, {"or", OR},
{"order", ORDER}, {"order", ORDER},
{"outer", OUTER_P}, {"outer", OUTER_P},
{"overlaps", OVERLAPS},
{"partial", PARTIAL}, {"partial", PARTIAL},
{"password", PASSWORD}, {"password", PASSWORD},
{"pendant", PENDANT}, {"pendant", PENDANT},
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.34 2000/02/15 03:37:47 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.35 2000/03/14 23:06:32 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -111,7 +111,7 @@ check_ungrouped_columns_walker(Node *node, ...@@ -111,7 +111,7 @@ check_ungrouped_columns_walker(Node *node,
elog(ERROR, "cache lookup of attribute %d in relation %u failed", elog(ERROR, "cache lookup of attribute %d in relation %u failed",
var->varattno, rte->relid); var->varattno, rte->relid);
elog(ERROR, "Attribute %s.%s must be GROUPed or used in an aggregate function", elog(ERROR, "Attribute %s.%s must be GROUPed or used in an aggregate function",
rte->ref->relname, attname); rte->eref->relname, attname);
} }
/* Otherwise, recurse. */ /* Otherwise, recurse. */
return expression_tree_walker(node, check_ungrouped_columns_walker, return expression_tree_walker(node, check_ungrouped_columns_walker,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.55 2000/02/19 23:45:05 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.56 2000/03/14 23:06:32 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -478,7 +478,7 @@ parseFromClause(ParseState *pstate, List *frmList) ...@@ -478,7 +478,7 @@ parseFromClause(ParseState *pstate, List *frmList)
{ {
Assert(IsA(j->larg, RangeVar)); Assert(IsA(j->larg, RangeVar));
l_rte = transformTableEntry(pstate, (RangeVar *) j->larg); l_rte = transformTableEntry(pstate, (RangeVar *) j->larg);
l_name = expandTable(pstate, l_rte->ref->relname, TRUE); l_name = expandTable(pstate, l_rte->eref->relname, TRUE);
} }
if (IsA(j->rarg, JoinExpr)) if (IsA(j->rarg, JoinExpr))
...@@ -490,7 +490,7 @@ parseFromClause(ParseState *pstate, List *frmList) ...@@ -490,7 +490,7 @@ parseFromClause(ParseState *pstate, List *frmList)
{ {
Assert(IsA(j->rarg, RangeVar)); Assert(IsA(j->rarg, RangeVar));
r_rte = transformTableEntry(pstate, (RangeVar *) j->rarg); r_rte = transformTableEntry(pstate, (RangeVar *) j->rarg);
r_name = expandTable(pstate, r_rte->ref->relname, TRUE); r_name = expandTable(pstate, r_rte->eref->relname, TRUE);
} }
/* Natural join does not explicitly specify columns; must generate columns to join. /* Natural join does not explicitly specify columns; must generate columns to join.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.34 2000/03/11 23:19:50 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.35 2000/03/14 23:06:32 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -319,6 +319,7 @@ TypeCategory(Oid inType) ...@@ -319,6 +319,7 @@ TypeCategory(Oid inType)
case (DATEOID): case (DATEOID):
case (TIMEOID): case (TIMEOID):
case (TIMETZOID):
case (ABSTIMEOID): case (ABSTIMEOID):
case (TIMESTAMPOID): case (TIMESTAMPOID):
result = DATETIME_TYPE; result = DATETIME_TYPE;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.72 2000/03/07 23:30:53 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.73 2000/03/14 23:06:32 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -574,15 +574,7 @@ transformIdent(ParseState *pstate, Ident *ident, int precedence) ...@@ -574,15 +574,7 @@ transformIdent(ParseState *pstate, Ident *ident, int precedence)
if ((rte = colnameRangeTableEntry(pstate, ident->name)) != NULL) if ((rte = colnameRangeTableEntry(pstate, ident->name)) != NULL)
{ {
/* Convert it to a fully qualified Attr, and transform that */ /* Convert it to a fully qualified Attr, and transform that */
#ifndef DISABLE_JOIN_SYNTAX Attr *att = makeAttr(rte->eref->relname, ident->name);
Attr *att = makeAttr(rte->ref->relname, ident->name);
#else
Attr *att = makeNode(Attr);
att->relname = rte->refname;
att->paramNo = NULL;
att->attrs = lcons(makeString(ident->name), NIL);
#endif
att->indirection = ident->indirection; att->indirection = ident->indirection;
return transformAttr(pstate, att, precedence); return transformAttr(pstate, att, precedence);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.73 2000/03/11 23:17:47 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.74 2000/03/14 23:06:32 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -325,7 +325,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs, ...@@ -325,7 +325,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
* now allow column aliases. * now allow column aliases.
* - thomas 2000-02-07 * - thomas 2000-02-07
*/ */
if (rte->ref->attrs != NULL) if (rte->eref->attrs != NULL)
{ {
List *c; List *c;
/* start counting attributes/columns from one. /* start counting attributes/columns from one.
...@@ -333,7 +333,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs, ...@@ -333,7 +333,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
* - thomas 2000-01-27 * - thomas 2000-01-27
*/ */
int i = 1; int i = 1;
foreach (c, rte->ref->attrs) foreach (c, rte->eref->attrs)
{ {
char *colname = strVal(lfirst(c)); char *colname = strVal(lfirst(c));
/* found a match? */ /* found a match? */
...@@ -550,7 +550,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs, ...@@ -550,7 +550,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
relname = rte->relname; relname = rte->relname;
vnum = refnameRangeTablePosn(pstate, rte->ref->relname, NULL); vnum = refnameRangeTablePosn(pstate, rte->eref->relname, NULL);
/* /*
* for func(relname), the param to the function is the tuple * for func(relname), the param to the function is the tuple
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.36 2000/03/09 05:00:24 inoue Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.37 2000/03/14 23:06:33 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -68,8 +68,12 @@ static char *attnum_type[SPECIALS] = { ...@@ -68,8 +68,12 @@ static char *attnum_type[SPECIALS] = {
/* refnameRangeTableEntries() /* refnameRangeTableEntries()
* Given refname, return a list of range table entries * Given refname, return a list of range table entries
* This is possible with JOIN syntax, where tables in a join * This is possible with JOIN syntax, where tables in a join
* acquire the same reference name * acquire the same reference name.
* - thomas 2000-01-20 * - thomas 2000-01-20
* But at the moment we aren't carrying along a full list of
* table/column aliases, so we don't have the full mechanism
* to support outer joins in place yet.
* - thomas 2000-03-04
*/ */
List * List *
refnameRangeTableEntries(ParseState *pstate, char *refname); refnameRangeTableEntries(ParseState *pstate, char *refname);
...@@ -86,7 +90,7 @@ refnameRangeTableEntries(ParseState *pstate, char *refname) ...@@ -86,7 +90,7 @@ refnameRangeTableEntries(ParseState *pstate, char *refname)
{ {
RangeTblEntry *rte = lfirst(temp); RangeTblEntry *rte = lfirst(temp);
if (strcmp(rte->ref->relname, refname) == 0) if (strcmp(rte->eref->relname, refname) == 0)
rteList = lappend(rteList, rte); rteList = lappend(rteList, rte);
} }
/* only allow correlated columns in WHERE clause */ /* only allow correlated columns in WHERE clause */
...@@ -110,11 +114,7 @@ refnameRangeTableEntry(ParseState *pstate, char *refname) ...@@ -110,11 +114,7 @@ refnameRangeTableEntry(ParseState *pstate, char *refname)
{ {
RangeTblEntry *rte = lfirst(temp); RangeTblEntry *rte = lfirst(temp);
#ifndef DISABLE_JOIN_SYNTAX if (strcmp(rte->eref->relname, refname) == 0)
if (strcmp(rte->ref->relname, refname) == 0)
#else
if (!strcmp(rte->refname, refname))
#endif
return rte; return rte;
} }
/* only allow correlated columns in WHERE clause */ /* only allow correlated columns in WHERE clause */
...@@ -143,11 +143,7 @@ refnameRangeTablePosn(ParseState *pstate, char *refname, int *sublevels_up) ...@@ -143,11 +143,7 @@ refnameRangeTablePosn(ParseState *pstate, char *refname, int *sublevels_up)
{ {
RangeTblEntry *rte = lfirst(temp); RangeTblEntry *rte = lfirst(temp);
#ifndef DISABLE_JOIN_SYNTAX if (strcmp(rte->eref->relname, refname) == 0)
if (strcmp(rte->ref->relname, refname) == 0)
#else
if (!strcmp(rte->refname, refname))
#endif
return index; return index;
index++; index++;
} }
...@@ -191,7 +187,7 @@ colnameRangeTableEntry(ParseState *pstate, char *colname) ...@@ -191,7 +187,7 @@ colnameRangeTableEntry(ParseState *pstate, char *colname)
if (!rte->inFromCl && rte != pstate->p_target_rangetblentry) if (!rte->inFromCl && rte != pstate->p_target_rangetblentry)
continue; continue;
if (rte->ref->attrs != NULL) if (rte->eref->attrs != NULL)
{ {
List *c; List *c;
foreach (c, rte->ref->attrs) foreach (c, rte->ref->attrs)
...@@ -253,6 +249,7 @@ addRangeTableEntry(ParseState *pstate, ...@@ -253,6 +249,7 @@ addRangeTableEntry(ParseState *pstate,
{ {
Relation rel; Relation rel;
RangeTblEntry *rte; RangeTblEntry *rte;
Attr *eref;
int maxattrs; int maxattrs;
int sublevels_up; int sublevels_up;
int varattno; int varattno;
...@@ -286,19 +283,22 @@ addRangeTableEntry(ParseState *pstate, ...@@ -286,19 +283,22 @@ addRangeTableEntry(ParseState *pstate,
rel = heap_openr(relname, AccessShareLock); rel = heap_openr(relname, AccessShareLock);
rte->relid = RelationGetRelid(rel); rte->relid = RelationGetRelid(rel);
maxattrs = RelationGetNumberOfAttributes(rel); maxattrs = RelationGetNumberOfAttributes(rel);
if (maxattrs < length(ref->attrs))
eref = copyObject(ref);
if (maxattrs < length(eref->attrs))
elog(ERROR, "Table '%s' has %d columns available but %d columns specified", elog(ERROR, "Table '%s' has %d columns available but %d columns specified",
relname, maxattrs, length(ref->attrs)); relname, maxattrs, length(eref->attrs));
/* fill in any unspecified alias columns */ /* fill in any unspecified alias columns */
for (varattno = length(ref->attrs); varattno < maxattrs; varattno++) for (varattno = length(eref->attrs); varattno < maxattrs; varattno++)
{ {
char *attrname; char *attrname;
attrname = pstrdup(NameStr(rel->rd_att->attrs[varattno]->attname)); attrname = pstrdup(NameStr(rel->rd_att->attrs[varattno]->attname));
ref->attrs = lappend(ref->attrs, makeString(attrname)); eref->attrs = lappend(eref->attrs, makeString(attrname));
} }
heap_close(rel, AccessShareLock); heap_close(rel, AccessShareLock);
rte->eref = eref;
/* /*
* Flags: * Flags:
...@@ -337,10 +337,9 @@ expandTable(ParseState *pstate, char *refname, bool getaliases) ...@@ -337,10 +337,9 @@ expandTable(ParseState *pstate, char *refname, bool getaliases)
rte = refnameRangeTableEntry(pstate, refname); rte = refnameRangeTableEntry(pstate, refname);
if (getaliases && (rte != NULL) && (rte->ref != NULL) if (getaliases && (rte != NULL))
&& (length(rte->ref->attrs) > 0))
{ {
return rte->ref; return rte->eref;
} }
if (rte != NULL) if (rte != NULL)
...@@ -415,8 +414,8 @@ expandAll(ParseState *pstate, char *relname, Attr *ref, int *this_resno) ...@@ -415,8 +414,8 @@ expandAll(ParseState *pstate, char *relname, Attr *ref, int *this_resno)
attrname = pstrdup(NameStr(rel->rd_att->attrs[varattno]->attname)); attrname = pstrdup(NameStr(rel->rd_att->attrs[varattno]->attname));
/* varattno is zero-based, so check that length() is always greater */ /* varattno is zero-based, so check that length() is always greater */
if (length(rte->ref->attrs) > varattno) if (length(rte->eref->attrs) > varattno)
label = pstrdup(strVal(nth(varattno, rte->ref->attrs))); label = pstrdup(strVal(nth(varattno, rte->eref->attrs)));
else else
label = attrname; label = attrname;
varnode = make_var(pstate, rte->relid, relname, attrname); varnode = make_var(pstate, rte->relid, relname, attrname);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.56 2000/03/09 05:00:24 inoue Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.57 2000/03/14 23:06:33 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -430,7 +430,7 @@ ExpandAllTables(ParseState *pstate) ...@@ -430,7 +430,7 @@ ExpandAllTables(ParseState *pstate)
continue; continue;
target = nconc(target, target = nconc(target,
expandAll(pstate, rte->ref->relname, rte->ref, expandAll(pstate, rte->eref->relname, rte->eref,
&pstate->p_last_resno)); &pstate->p_last_resno));
} }
return target; return target;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.42 2000/02/16 18:17:02 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.43 2000/03/14 23:06:35 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -198,7 +198,7 @@ date_timestamp(DateADT dateVal) ...@@ -198,7 +198,7 @@ date_timestamp(DateADT dateVal)
double fsec = 0; double fsec = 0;
char *tzn; char *tzn;
result = palloc(sizeof(Timestamp)); result = palloc(sizeof(*result));
if (date2tm(dateVal, &tz, tm, &fsec, &tzn) != 0) if (date2tm(dateVal, &tz, tm, &fsec, &tzn) != 0)
elog(ERROR, "Unable to convert date to timestamp"); elog(ERROR, "Unable to convert date to timestamp");
...@@ -392,10 +392,10 @@ time_in(char *str) ...@@ -392,10 +392,10 @@ time_in(char *str)
elog(ERROR, "Bad (null) time external representation"); elog(ERROR, "Bad (null) time external representation");
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeTimeOnly(field, ftype, nf, &dtype, tm, &fsec) != 0)) || (DecodeTimeOnly(field, ftype, nf, &dtype, tm, &fsec, NULL) != 0))
elog(ERROR, "Bad time external representation '%s'", str); elog(ERROR, "Bad time external representation '%s'", str);
time = palloc(sizeof(TimeADT)); time = palloc(sizeof(*time));
*time = ((((tm->tm_hour * 60) + tm->tm_min) * 60) + tm->tm_sec + fsec); *time = ((((tm->tm_hour * 60) + tm->tm_min) * 60) + tm->tm_sec + fsec);
...@@ -422,7 +422,7 @@ time_out(TimeADT *time) ...@@ -422,7 +422,7 @@ time_out(TimeADT *time)
fsec = 0; fsec = 0;
EncodeTimeOnly(tm, fsec, DateStyle, buf); EncodeTimeOnly(tm, fsec, NULL, DateStyle, buf);
result = palloc(strlen(buf) + 1); result = palloc(strlen(buf) + 1);
...@@ -456,8 +456,8 @@ time_lt(TimeADT *time1, TimeADT *time2) ...@@ -456,8 +456,8 @@ time_lt(TimeADT *time1, TimeADT *time2)
if (!PointerIsValid(time1) || !PointerIsValid(time2)) if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE; return FALSE;
return *time1 < *time2; return (*time1 < *time2);
} /* time_eq() */ } /* time_lt() */
bool bool
time_le(TimeADT *time1, TimeADT *time2) time_le(TimeADT *time1, TimeADT *time2)
...@@ -465,8 +465,8 @@ time_le(TimeADT *time1, TimeADT *time2) ...@@ -465,8 +465,8 @@ time_le(TimeADT *time1, TimeADT *time2)
if (!PointerIsValid(time1) || !PointerIsValid(time2)) if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE; return FALSE;
return *time1 <= *time2; return (*time1 <= *time2);
} /* time_eq() */ } /* time_le() */
bool bool
time_gt(TimeADT *time1, TimeADT *time2) time_gt(TimeADT *time1, TimeADT *time2)
...@@ -474,8 +474,8 @@ time_gt(TimeADT *time1, TimeADT *time2) ...@@ -474,8 +474,8 @@ time_gt(TimeADT *time1, TimeADT *time2)
if (!PointerIsValid(time1) || !PointerIsValid(time2)) if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE; return FALSE;
return *time1 > *time2; return (*time1 > *time2);
} /* time_eq() */ } /* time_gt() */
bool bool
time_ge(TimeADT *time1, TimeADT *time2) time_ge(TimeADT *time1, TimeADT *time2)
...@@ -483,8 +483,8 @@ time_ge(TimeADT *time1, TimeADT *time2) ...@@ -483,8 +483,8 @@ time_ge(TimeADT *time1, TimeADT *time2)
if (!PointerIsValid(time1) || !PointerIsValid(time2)) if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE; return FALSE;
return *time1 >= *time2; return (*time1 >= *time2);
} /* time_eq() */ } /* time_ge() */
int int
time_cmp(TimeADT *time1, TimeADT *time2) time_cmp(TimeADT *time1, TimeADT *time2)
...@@ -492,6 +492,43 @@ time_cmp(TimeADT *time1, TimeADT *time2) ...@@ -492,6 +492,43 @@ time_cmp(TimeADT *time1, TimeADT *time2)
return (*time1 < *time2) ? -1 : (((*time1 > *time2) ? 1 : 0)); return (*time1 < *time2) ? -1 : (((*time1 > *time2) ? 1 : 0));
} /* time_cmp() */ } /* time_cmp() */
TimeADT *
time_larger(TimeADT *time1, TimeADT *time2)
{
return time_gt(time1, time2)? time1: time2;
} /* time_larger() */
TimeADT *
time_smaller(TimeADT *time1, TimeADT *time2)
{
return time_lt(time1, time2)? time1: time2;
} /* time_smaller() */
/* overlaps_time()
* Implements the SQL92 OVERLAPS operator.
* Algorithm from Date and Darwen, 1997
*/
bool
overlaps_time(TimeADT *ts1, TimeADT *te1, TimeADT *ts2, TimeADT *te2)
{
/* Make sure we have ordered pairs... */
if (time_gt(ts1, te1))
{
TimeADT *tt = ts1;
ts1 = te1;
te1 = tt;
}
if (time_gt(ts2, te2))
{
TimeADT *tt = ts2;
ts2 = te2;
te2 = tt;
}
return ((time_gt(ts1, ts2) && (time_lt(ts1, te2) || time_lt(te1, te2)))
|| (time_gt(ts2, ts1) && (time_lt(ts2, te1) || time_lt(te2, te1)))
|| time_eq(ts1, ts2));
}
/* timestamp_time() /* timestamp_time()
* Convert timestamp to time data type. * Convert timestamp to time data type.
...@@ -515,12 +552,10 @@ timestamp_time(Timestamp *timestamp) ...@@ -515,12 +552,10 @@ timestamp_time(Timestamp *timestamp)
if (TIMESTAMP_IS_EPOCH(*timestamp)) if (TIMESTAMP_IS_EPOCH(*timestamp))
{ {
timestamp2tm(SetTimestamp(*timestamp), NULL, tm, &fsec, NULL); timestamp2tm(SetTimestamp(*timestamp), NULL, tm, &fsec, NULL);
} }
else if (TIMESTAMP_IS_CURRENT(*timestamp)) else if (TIMESTAMP_IS_CURRENT(*timestamp))
{ {
timestamp2tm(SetTimestamp(*timestamp), &tz, tm, &fsec, &tzn); timestamp2tm(SetTimestamp(*timestamp), &tz, tm, &fsec, &tzn);
} }
else else
{ {
...@@ -528,7 +563,7 @@ timestamp_time(Timestamp *timestamp) ...@@ -528,7 +563,7 @@ timestamp_time(Timestamp *timestamp)
elog(ERROR, "Unable to convert timestamp to date"); elog(ERROR, "Unable to convert timestamp to date");
} }
result = palloc(sizeof(TimeADT)); result = palloc(sizeof(*result));
*result = ((((tm->tm_hour * 60) + tm->tm_min) * 60) + tm->tm_sec + fsec); *result = ((((tm->tm_hour * 60) + tm->tm_min) * 60) + tm->tm_sec + fsec);
...@@ -546,7 +581,7 @@ datetime_timestamp(DateADT date, TimeADT *time) ...@@ -546,7 +581,7 @@ datetime_timestamp(DateADT date, TimeADT *time)
if (!PointerIsValid(time)) if (!PointerIsValid(time))
{ {
result = palloc(sizeof(Timestamp)); result = palloc(sizeof(*result));
TIMESTAMP_INVALID(*result); TIMESTAMP_INVALID(*result);
} }
else else
...@@ -557,3 +592,270 @@ datetime_timestamp(DateADT date, TimeADT *time) ...@@ -557,3 +592,270 @@ datetime_timestamp(DateADT date, TimeADT *time)
return result; return result;
} /* datetime_timestamp() */ } /* datetime_timestamp() */
/* time_interval()
* Convert time to interval data type.
*/
Interval *
time_interval(TimeADT *time)
{
Interval *result;
if (!PointerIsValid(time))
return NULL;
result = palloc(sizeof(*result));
result->time = *time;
result->month = 0;
return result;
} /* time_interval() */
/*****************************************************************************
* Time With Time Zone ADT
*****************************************************************************/
TimeTzADT *
timetz_in(char *str)
{
TimeTzADT *time;
double fsec;
struct tm tt,
*tm = &tt;
int tz;
int nf;
char lowstr[MAXDATELEN + 1];
char *field[MAXDATEFIELDS];
int dtype;
int ftype[MAXDATEFIELDS];
if (!PointerIsValid(str))
elog(ERROR, "Bad (null) time external representation");
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeTimeOnly(field, ftype, nf, &dtype, tm, &fsec, &tz) != 0))
elog(ERROR, "Bad time external representation '%s'", str);
time = palloc(sizeof(*time));
time->time = ((((tm->tm_hour * 60) + tm->tm_min) * 60) + tm->tm_sec + fsec);
time->zone = tz;
return time;
} /* timetz_in() */
char *
timetz_out(TimeTzADT *time)
{
char *result;
struct tm tt,
*tm = &tt;
double fsec;
int tz;
char buf[MAXDATELEN + 1];
if (!PointerIsValid(time))
return NULL;
tm->tm_hour = (time->time / (60 * 60));
tm->tm_min = (((int) (time->time / 60)) % 60);
tm->tm_sec = (((int) time->time) % 60);
fsec = 0;
tz = time->zone;
EncodeTimeOnly(tm, fsec, &tz, DateStyle, buf);
result = palloc(strlen(buf) + 1);
strcpy(result, buf);
return result;
} /* timetz_out() */
bool
timetz_eq(TimeTzADT *time1, TimeTzADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE;
return ((time1->time + time1->zone) == (time2->time + time2->zone));
} /* timetz_eq() */
bool
timetz_ne(TimeTzADT *time1, TimeTzADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE;
return ((time1->time + time1->zone) != (time2->time + time2->zone));
} /* timetz_ne() */
bool
timetz_lt(TimeTzADT *time1, TimeTzADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE;
return ((time1->time + time1->zone) < (time2->time + time2->zone));
} /* timetz_lt() */
bool
timetz_le(TimeTzADT *time1, TimeTzADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE;
return ((time1->time + time1->zone) <= (time2->time + time2->zone));
} /* timetz_le() */
bool
timetz_gt(TimeTzADT *time1, TimeTzADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE;
return ((time1->time + time1->zone) > (time2->time + time2->zone));
} /* timetz_gt() */
bool
timetz_ge(TimeTzADT *time1, TimeTzADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return FALSE;
return ((time1->time + time1->zone) >= (time2->time + time2->zone));
} /* timetz_ge() */
int
timetz_cmp(TimeTzADT *time1, TimeTzADT *time2)
{
return (timetz_lt(time1, time2) ? -1 : (timetz_gt(time1, time2)? 1: 0));
} /* timetz_cmp() */
TimeTzADT *
timetz_larger(TimeTzADT *time1, TimeTzADT *time2)
{
return timetz_gt(time1, time2)? time1: time2;
} /* timetz_larger() */
TimeTzADT *
timetz_smaller(TimeTzADT *time1, TimeTzADT *time2)
{
return timetz_lt(time1, time2)? time1: time2;
} /* timetz_smaller() */
/* overlaps_timetz()
* Implements the SQL92 OVERLAPS operator.
* Algorithm from Date and Darwen, 1997
*/
bool
overlaps_timetz(TimeTzADT *ts1, TimeTzADT *te1, TimeTzADT *ts2, TimeTzADT *te2)
{
/* Make sure we have ordered pairs... */
if (timetz_gt(ts1, te1))
{
TimeTzADT *tt = ts1;
ts1 = te1;
te1 = tt;
}
if (timetz_gt(ts2, te2))
{
TimeTzADT *tt = ts2;
ts2 = te2;
te2 = tt;
}
return ((timetz_gt(ts1, ts2) && (timetz_lt(ts1, te2) || timetz_lt(te1, te2)))
|| (timetz_gt(ts2, ts1) && (timetz_lt(ts2, te1) || timetz_lt(te2, te1)))
|| timetz_eq(ts1, ts2));
} /* overlaps_timetz() */
/* timestamp_timetz()
* Convert timestamp to timetz data type.
*/
TimeTzADT *
timestamp_timetz(Timestamp *timestamp)
{
TimeTzADT *result;
struct tm tt,
*tm = &tt;
int tz;
double fsec;
char *tzn;
if (!PointerIsValid(timestamp))
elog(ERROR, "Unable to convert null timestamp to date");
if (TIMESTAMP_NOT_FINITE(*timestamp))
elog(ERROR, "Unable to convert timestamp to date");
if (TIMESTAMP_IS_EPOCH(*timestamp))
{
timestamp2tm(SetTimestamp(*timestamp), NULL, tm, &fsec, NULL);
tz = 0;
}
else if (TIMESTAMP_IS_CURRENT(*timestamp))
{
timestamp2tm(SetTimestamp(*timestamp), &tz, tm, &fsec, &tzn);
}
else
{
if (timestamp2tm(*timestamp, &tz, tm, &fsec, &tzn) != 0)
elog(ERROR, "Unable to convert timestamp to date");
}
result = palloc(sizeof(*result));
result->time = ((((tm->tm_hour * 60) + tm->tm_min) * 60) + tm->tm_sec + fsec);
result->zone = tz;
return result;
} /* timestamp_timetz() */
/* datetimetz_timestamp()
* Convert date and timetz to timestamp data type.
* Timestamp is stored in GMT, so add the time zone
* stored with the timetz to the result.
* - thomas 2000-03-10
*/
Timestamp *
datetimetz_timestamp(DateADT date, TimeTzADT *time)
{
Timestamp *result;
struct tm tt,
*tm = &tt;
int tz;
double fsec = 0;
char *tzn;
result = palloc(sizeof(*result));
if (!PointerIsValid(date) || !PointerIsValid(time))
{
TIMESTAMP_INVALID(*result);
}
else
{
if (date2tm(date, &tz, tm, &fsec, &tzn) != 0)
elog(ERROR, "Unable to convert date to timestamp");
if (tm2timestamp(tm, fsec, &time->zone, result) != 0)
elog(ERROR, "Timestamp out of range");
*result += time->time;
}
return result;
} /* datetimetz_timestamp() */
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.42 2000/02/16 18:17:02 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.43 2000/03/14 23:06:36 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -618,8 +618,7 @@ DecodeDateTime(char **field, int *ftype, int nf, ...@@ -618,8 +618,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
tm->tm_min = 0; tm->tm_min = 0;
tm->tm_sec = 0; tm->tm_sec = 0;
*fsec = 0; *fsec = 0;
tm->tm_isdst = -1; /* don't know daylight savings time status tm->tm_isdst = -1; /* don't know daylight savings time status apriori */
* apriori */
if (tzp != NULL) if (tzp != NULL)
*tzp = 0; *tzp = 0;
...@@ -897,8 +896,7 @@ DecodeDateTime(char **field, int *ftype, int nf, ...@@ -897,8 +896,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
tm->tm_mon += 1; tm->tm_mon += 1;
#if defined(HAVE_TM_ZONE) #if defined(HAVE_TM_ZONE)
*tzp = -(tm->tm_gmtoff); /* tm_gmtoff is *tzp = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */
* Sun/DEC-ism */
#elif defined(HAVE_INT_TIMEZONE) #elif defined(HAVE_INT_TIMEZONE)
#ifdef __CYGWIN__ #ifdef __CYGWIN__
*tzp = ((tm->tm_isdst > 0) ? (_timezone - 3600) : _timezone); *tzp = ((tm->tm_isdst > 0) ? (_timezone - 3600) : _timezone);
...@@ -927,9 +925,18 @@ DecodeDateTime(char **field, int *ftype, int nf, ...@@ -927,9 +925,18 @@ DecodeDateTime(char **field, int *ftype, int nf,
/* DecodeTimeOnly() /* DecodeTimeOnly()
* Interpret parsed string as time fields only. * Interpret parsed string as time fields only.
* Note that support for time zone is here for
* SQL92 TIME WITH TIME ZONE, but it reveals
* bogosity with SQL92 date/time standards, since
* we must infer a time zone from current time.
* XXX Later, we should probably support
* SET TIME ZONE <integer>
* which of course is a screwed up convention.
* - thomas 2000-03-10
*/ */
int int
DecodeTimeOnly(char **field, int *ftype, int nf, int *dtype, struct tm * tm, double *fsec) DecodeTimeOnly(char **field, int *ftype, int nf,
int *dtype, struct tm * tm, double *fsec, int *tzp)
{ {
int fmask, int fmask,
tmask, tmask,
...@@ -944,9 +951,10 @@ DecodeTimeOnly(char **field, int *ftype, int nf, int *dtype, struct tm * tm, dou ...@@ -944,9 +951,10 @@ DecodeTimeOnly(char **field, int *ftype, int nf, int *dtype, struct tm * tm, dou
tm->tm_hour = 0; tm->tm_hour = 0;
tm->tm_min = 0; tm->tm_min = 0;
tm->tm_sec = 0; tm->tm_sec = 0;
tm->tm_isdst = -1; /* don't know daylight savings time status
* apriori */
*fsec = 0; *fsec = 0;
tm->tm_isdst = -1; /* don't know daylight savings time status apriori */
if (tzp != NULL)
*tzp = 0;
fmask = DTK_DATE_M; fmask = DTK_DATE_M;
...@@ -959,6 +967,14 @@ DecodeTimeOnly(char **field, int *ftype, int nf, int *dtype, struct tm * tm, dou ...@@ -959,6 +967,14 @@ DecodeTimeOnly(char **field, int *ftype, int nf, int *dtype, struct tm * tm, dou
return -1; return -1;
break; break;
case DTK_TZ:
if (tzp == NULL)
return -1;
if (DecodeTimezone(field[i], tzp) != 0)
return -1;
tmask = DTK_M(TZ);
break;
case DTK_NUMBER: case DTK_NUMBER:
flen = strlen(field[i]); flen = strlen(field[i]);
...@@ -1035,6 +1051,45 @@ DecodeTimeOnly(char **field, int *ftype, int nf, int *dtype, struct tm * tm, dou ...@@ -1035,6 +1051,45 @@ DecodeTimeOnly(char **field, int *ftype, int nf, int *dtype, struct tm * tm, dou
if ((fmask & DTK_TIME_M) != DTK_TIME_M) if ((fmask & DTK_TIME_M) != DTK_TIME_M)
return -1; return -1;
/* timezone not specified? then find local timezone if possible */
if ((tzp != NULL) && (!(fmask & DTK_M(TZ))))
{
struct tm tt, *tmp = &tt;
/*
* daylight savings time modifier but no standard timezone?
* then error
*/
if (fmask & DTK_M(DTZMOD))
return -1;
GetCurrentTime(tmp);
tmp->tm_hour = tm->tm_hour;
tmp->tm_min = tm->tm_min;
tmp->tm_sec = tm->tm_sec;
#ifdef USE_POSIX_TIME
tmp->tm_isdst = -1;
mktime(tmp);
tm->tm_isdst = tmp->tm_isdst;
#if defined(HAVE_TM_ZONE)
*tzp = -(tmp->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */
#elif defined(HAVE_INT_TIMEZONE)
#ifdef __CYGWIN__
*tzp = ((tmp->tm_isdst > 0) ? (_timezone - 3600) : _timezone);
#else
*tzp = ((tmp->tm_isdst > 0) ? (timezone - 3600) : timezone);
#endif
#else
#error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined
#endif
#else /* !USE_POSIX_TIME */
*tzp = CTimeZone;
#endif
}
return 0; return 0;
} /* DecodeTimeOnly() */ } /* DecodeTimeOnly() */
...@@ -1830,7 +1885,7 @@ EncodeDateOnly(struct tm * tm, int style, char *str) ...@@ -1830,7 +1885,7 @@ EncodeDateOnly(struct tm * tm, int style, char *str)
* Encode time fields only. * Encode time fields only.
*/ */
int int
EncodeTimeOnly(struct tm * tm, double fsec, int style, char *str) EncodeTimeOnly(struct tm * tm, double fsec, int *tzp, int style, char *str)
{ {
double sec; double sec;
...@@ -1842,6 +1897,15 @@ EncodeTimeOnly(struct tm * tm, double fsec, int style, char *str) ...@@ -1842,6 +1897,15 @@ EncodeTimeOnly(struct tm * tm, double fsec, int style, char *str)
sprintf(str, "%02d:%02d:", tm->tm_hour, tm->tm_min); sprintf(str, "%02d:%02d:", tm->tm_hour, tm->tm_min);
sprintf((str + 6), ((fsec != 0) ? "%05.2f" : "%02.0f"), sec); sprintf((str + 6), ((fsec != 0) ? "%05.2f" : "%02.0f"), sec);
if (tzp != NULL)
{
int hour, min;
hour = -(*tzp / 3600);
min = ((abs(*tzp) / 60) % 60);
sprintf((str + strlen(str)), ((min != 0) ? "%+03d:%02d" : "%+03d"), hour, min);
}
return TRUE; return TRUE;
} /* EncodeTimeOnly() */ } /* EncodeTimeOnly() */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.53 2000/01/26 05:57:14 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.54 2000/03/14 23:06:36 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1236,6 +1236,31 @@ dlog1(float64 arg1) ...@@ -1236,6 +1236,31 @@ dlog1(float64 arg1)
return result; return result;
} }
/*
* dlog10 - returns a pointer to the base 10 logarithm of arg1
*/
float64
dlog10(float64 arg1)
{
float64 result;
double tmp;
if (!PointerIsValid(arg1))
return (float64) NULL;
result = (float64) palloc(sizeof(float64data));
tmp = *arg1;
if (tmp == 0.0)
elog(ERROR, "can't take log of zero");
if (tmp < 0)
elog(ERROR, "can't take log of a negative number");
*result = (float64data) log10(tmp);
CheckFloat8Val(*result);
return result;
} /* dlog10() */
/* /*
* ==================== * ====================
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.48 2000/01/26 05:57:14 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.49 2000/03/14 23:06:36 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -3510,29 +3510,6 @@ path_div_pt(PATH *path, Point *point) ...@@ -3510,29 +3510,6 @@ path_div_pt(PATH *path, Point *point)
} /* path_div_pt() */ } /* path_div_pt() */
bool
path_contain_pt(PATH *path, Point *p)
{
if (!PointerIsValid(path) || !PointerIsValid(p))
return FALSE;
return (on_ppath(p, path));
} /* path_contain_pt() */
/* pt_contained_path
* Point in or on path? This is the same as on_ppath.
* - thomas 1998-10-29
*/
bool
pt_contained_path(Point *p, PATH *path)
{
if (!PointerIsValid(p) || !PointerIsValid(path))
return FALSE;
return path_contain_pt(path, p);
} /* pt_contained_path() */
Point * Point *
path_center(PATH *path) path_center(PATH *path)
{ {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.34 2000/03/07 23:58:38 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.35 2000/03/14 23:06:36 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -659,8 +659,8 @@ int42mod(int32 arg1, int32 arg2) ...@@ -659,8 +659,8 @@ int42mod(int32 arg1, int32 arg2)
return arg1 % arg2; return arg1 % arg2;
} }
/* /* int[24]fac()
* int[24]fac - returns arg1! * Factorial
*/ */
int32 int32
int4fac(int32 arg1) int4fac(int32 arg1)
...@@ -678,7 +678,7 @@ int4fac(int32 arg1) ...@@ -678,7 +678,7 @@ int4fac(int32 arg1)
int32 int32
int2fac(int16 arg1) int2fac(int16 arg1)
{ {
int16 result; int32 result;
if (arg1 < 1) if (arg1 < 1)
result = 0; result = 0;
...@@ -688,6 +688,21 @@ int2fac(int16 arg1) ...@@ -688,6 +688,21 @@ int2fac(int16 arg1)
return result; return result;
} }
/* int[24]abs()
* Absolute value
*/
int32
int4abs(int32 arg1)
{
return ((arg1 < 0)? -arg1: arg1);
}
int16
int2abs(int16 arg1)
{
return ((arg1 < 0)? -arg1: arg1);
}
int16 int16
int2larger(int16 arg1, int16 arg2) int2larger(int16 arg1, int16 arg2)
{ {
......
...@@ -359,6 +359,63 @@ int8div(int64 *val1, int64 *val2) ...@@ -359,6 +359,63 @@ int8div(int64 *val1, int64 *val2)
return result; return result;
} /* int8div() */ } /* int8div() */
/* int8abs()
* Absolute value
*/
int64 *
int8abs(int64 *arg1)
{
int64 *result;
if (!PointerIsValid(arg1))
return NULL;
result = palloc(sizeof(*result));
*result = ((*arg1 < 0)? -*arg1: *arg1);
return result;
}
/* int8mod()
* Modulo operation.
*/
int64 *
int8mod(int64 *val1, int64 *val2)
{
int64 *result;
/* use the divide operation to check params and allocate storage */
result = int8div(val1, val2);
*result *= *val2;
*result = *val1 - *result;
return result;
} /* int8mod() */
/* int8fac()
* Factorial
*/
int64 *
int8fac(int64 *arg1)
{
int64 *result;
int64 i;
if (!PointerIsValid(arg1))
return NULL;
result = palloc(sizeof(*result));
if (*arg1 < 1)
*result = 0;
else
for (i = *arg1, *result = 1; i > 0; --i)
*result *= i;
return result;
}
int64 * int64 *
int8larger(int64 *val1, int64 *val2) int8larger(int64 *val1, int64 *val2)
{ {
...@@ -634,4 +691,4 @@ int8_text(int64 *val) ...@@ -634,4 +691,4 @@ int8_text(int64 *val)
memmove(VARDATA(result), s, len); memmove(VARDATA(result), s, len);
return result; return result;
} /* int8out() */ } /* int8_text() */
/* /*
* Edmund Mergl <E.Mergl@bawue.de> * Edmund Mergl <E.Mergl@bawue.de>
* *
* $Id: oracle_compat.c,v 1.20 1999/07/15 15:20:19 momjian Exp $ * $Id: oracle_compat.c,v 1.21 2000/03/14 23:06:37 thomas Exp $
* *
*/ */
#include <ctype.h> #include <ctype.h>
#include "postgres.h" #include "postgres.h"
#include "utils/builtins.h"
text *lower(text *string);
text *upper(text *string);
text *initcap(text *string);
text *lpad(text *string1, int4 len, text *string2);
text *rpad(text *string1, int4 len, text *string2);
text *btrim(text *string, text *set);
text *ltrim(text *string, text *set);
text *rtrim(text *string, text *set);
text *substr(text *string, int4 m, int4 n);
text *translate(text *string, char from, char to);
/******************************************************************** /********************************************************************
...@@ -506,42 +496,68 @@ substr(text *string, int4 m, int4 n) ...@@ -506,42 +496,68 @@ substr(text *string, int4 m, int4 n)
* *
* Syntax: * Syntax:
* *
* text *translate(text *string, char from, char to) * text *translate(text *string, text *from, text *to)
* *
* Purpose: * Purpose:
* *
* Returns string after replacing all occurences of from with * Returns string after replacing all occurences of from with
* the corresponding character in to. TRANSLATE will not remove * the corresponding character in to. TRANSLATE will not remove
* characters. * characters.
* Modified to work with strings rather than single character
* for the substitution arguments.
* Modifications from Edwin Ramirez <ramirez@doc.mssm.edu>.
* *
********************************************************************/ ********************************************************************/
text * text *
translate(text *string, char from, char to) translate(text *string, text *from, text *to)
{ {
text *ret; text *ret;
char *ptr, char *ptr_ret, *from_ptr, *to_ptr;
*ptr_ret; char *source, *target, *temp, rep;
int m; int m, fromlen, tolen, retlen, i;
if ((string == (text *) NULL) || if ((string == (text *) NULL) ||
((m = VARSIZE(string) - VARHDRSZ) <= 0)) ((m = VARSIZE(string) - VARHDRSZ) <= 0))
return string; return string;
ret = (text *) palloc(VARSIZE(string)); target = (char *) palloc(VARSIZE(string) - VARHDRSZ);
VARSIZE(ret) = VARSIZE(string); source = VARDATA(string);
temp = target;
ptr = VARDATA(string);
ptr_ret = VARDATA(ret);
fromlen = VARSIZE(from) - VARHDRSZ;
from_ptr = VARDATA(from);
tolen = VARSIZE(to) - VARHDRSZ;
to_ptr = VARDATA(to);
retlen = 0;
while (m--) while (m--)
{ {
*ptr_ret++ = *ptr == from ? to : *ptr; rep = *source;
ptr++; for(i=0;i<fromlen;i++) {
if(from_ptr[i] == *source) {
if(i < tolen) {
rep = to_ptr[i];
} else {
rep = 0;
}
break;
}
}
if(rep != 0) {
*target++ = rep;
retlen++;
}
source++;
} }
ret = (text *) palloc(retlen + VARHDRSZ);
VARSIZE(ret) = retlen + VARHDRSZ;
ptr_ret = VARDATA(ret);
for(i=0;i<retlen;i++) {
*ptr_ret++ = temp[i];
}
pfree(target);
return ret; return ret;
} }
/* EOF */ /* EOF */
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* out of its tuple * out of its tuple
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.44 2000/02/26 21:13:18 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.45 2000/03/14 23:06:37 thomas Exp $
* *
* This software is copyrighted by Jan Wieck - Hamburg. * This software is copyrighted by Jan Wieck - Hamburg.
* *
...@@ -923,6 +923,8 @@ get_select_query_def(Query *query, deparse_context *context) ...@@ -923,6 +923,8 @@ get_select_query_def(Query *query, deparse_context *context)
continue; continue;
rte = (RangeTblEntry *) lfirst(l); rte = (RangeTblEntry *) lfirst(l);
if (rte->ref == NULL)
continue;
if (!strcmp(rte->ref->relname, "*NEW*")) if (!strcmp(rte->ref->relname, "*NEW*"))
continue; continue;
if (!strcmp(rte->ref->relname, "*CURRENT*")) if (!strcmp(rte->ref->relname, "*CURRENT*"))
...@@ -982,9 +984,10 @@ get_select_query_def(Query *query, deparse_context *context) ...@@ -982,9 +984,10 @@ get_select_query_def(Query *query, deparse_context *context)
{ {
rte = (RangeTblEntry *) lfirst(l); rte = (RangeTblEntry *) lfirst(l);
if (rte->ref == NULL)
continue;
if (!strcmp(rte->ref->relname, "*NEW*")) if (!strcmp(rte->ref->relname, "*NEW*"))
continue; continue;
if (!strcmp(rte->ref->relname, "*CURRENT*")) if (!strcmp(rte->ref->relname, "*CURRENT*"))
continue; continue;
...@@ -1008,7 +1011,9 @@ get_select_query_def(Query *query, deparse_context *context) ...@@ -1008,7 +1011,9 @@ get_select_query_def(Query *query, deparse_context *context)
* Since we don't really support SQL joins yet, dropping * Since we don't really support SQL joins yet, dropping
* the list of column aliases doesn't hurt anything... * the list of column aliases doesn't hurt anything...
*/ */
if (strcmp(rte->relname, rte->ref->relname) != 0) if ((rte->ref != NULL)
&& ((strcmp(rte->relname, rte->ref->relname) != 0)
|| (rte->ref->attrs != NIL)))
{ {
appendStringInfo(buf, " %s", appendStringInfo(buf, " %s",
quote_identifier(rte->ref->relname)); quote_identifier(rte->ref->relname));
...@@ -1104,6 +1109,8 @@ get_insert_query_def(Query *query, deparse_context *context) ...@@ -1104,6 +1109,8 @@ get_insert_query_def(Query *query, deparse_context *context)
continue; continue;
rte = (RangeTblEntry *) lfirst(l); rte = (RangeTblEntry *) lfirst(l);
if (rte->ref == NULL)
continue;
if (!strcmp(rte->ref->relname, "*NEW*")) if (!strcmp(rte->ref->relname, "*NEW*"))
continue; continue;
if (!strcmp(rte->ref->relname, "*CURRENT*")) if (!strcmp(rte->ref->relname, "*CURRENT*"))
...@@ -1274,7 +1281,10 @@ get_rule_expr(Node *node, deparse_context *context) ...@@ -1274,7 +1281,10 @@ get_rule_expr(Node *node, deparse_context *context)
if (context->varprefix) if (context->varprefix)
{ {
if (!strcmp(rte->ref->relname, "*NEW*")) if (rte->ref == NULL)
appendStringInfo(buf, "%s.",
quote_identifier(rte->relname));
else if (!strcmp(rte->ref->relname, "*NEW*"))
appendStringInfo(buf, "new."); appendStringInfo(buf, "new.");
else if (!strcmp(rte->ref->relname, "*CURRENT*")) else if (!strcmp(rte->ref->relname, "*CURRENT*"))
appendStringInfo(buf, "old."); appendStringInfo(buf, "old.");
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.22 2000/02/16 17:24:48 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.23 2000/03/14 23:06:37 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -952,6 +952,32 @@ interval_cmp(Interval *interval1, Interval *interval2) ...@@ -952,6 +952,32 @@ interval_cmp(Interval *interval1, Interval *interval2)
return (span1 < span2) ? -1 : (span1 > span2) ? 1 : 0; return (span1 < span2) ? -1 : (span1 > span2) ? 1 : 0;
} /* interval_cmp() */ } /* interval_cmp() */
/* overlaps_timestamp()
* Implements the SQL92 OVERLAPS operator.
* Algorithm from Date and Darwen, 1997
*/
bool
overlaps_timestamp(Timestamp *ts1, Timestamp *te1, Timestamp *ts2, Timestamp *te2)
{
/* Make sure we have ordered pairs... */
if (timestamp_gt(ts1, te1))
{
Timestamp *tt = ts1;
ts1 = te1;
te1 = tt;
}
if (timestamp_gt(ts2, te2))
{
Timestamp *tt = ts2;
ts2 = te2;
te2 = tt;
}
return ((timestamp_gt(ts1, ts2) && (timestamp_lt(ts1, te2) || timestamp_lt(te1, te2)))
|| (timestamp_gt(ts2, ts1) && (timestamp_lt(ts2, te1) || timestamp_lt(te2, te1)))
|| timestamp_eq(ts1, ts2));
} /* overlaps_timestamp() */
/*---------------------------------------------------------- /*----------------------------------------------------------
* "Arithmetic" operators on date/times. * "Arithmetic" operators on date/times.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.6 2000/01/19 20:08:35 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.7 2000/03/14 23:06:41 thomas Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -241,11 +241,11 @@ if [ $? -ne 0 ]; then ...@@ -241,11 +241,11 @@ if [ $? -ne 0 ]; then
echo "$CMDNAME: language installation failed" echo "$CMDNAME: language installation failed"
exit 1 exit 1
fi fi
$PSQL "CREATE ${trusted}PROCEDURAL LANGUAGE '$langname' HANDLER $handler LANCOMPILER '$lancomp'" $PSQL "CREATE ${trusted}PROCEDURAL LANGUAGE '$langname' HANDLER $handler LANCOMPILER '$lancomp'"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$CMDNAME: language installation failed" echo "$CMDNAME: language installation failed"
exit 1 exit 1
fi fi
echo "Ok"
exit 0 exit 0
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: catversion.h,v 1.17 2000/02/27 18:06:28 tgl Exp $ * $Id: catversion.h,v 1.18 2000/03/14 23:06:42 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 200002271 #define CATALOG_VERSION_NO 200003141
#endif #endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_aggregate.h,v 1.23 2000/02/16 17:26:06 thomas Exp $ * $Id: pg_aggregate.h,v 1.24 2000/03/14 23:06:42 thomas Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -114,6 +114,8 @@ DATA(insert OID = 0 ( max PGUID float4larger - - 700 700 0 700 _null_ _null_ ...@@ -114,6 +114,8 @@ DATA(insert OID = 0 ( max PGUID float4larger - - 700 700 0 700 _null_ _null_
DATA(insert OID = 0 ( max PGUID float8larger - - 701 701 0 701 _null_ _null_ )); DATA(insert OID = 0 ( max PGUID float8larger - - 701 701 0 701 _null_ _null_ ));
DATA(insert OID = 0 ( max PGUID int4larger - - 702 702 0 702 _null_ _null_ )); DATA(insert OID = 0 ( max PGUID int4larger - - 702 702 0 702 _null_ _null_ ));
DATA(insert OID = 0 ( max PGUID date_larger - - 1082 1082 0 1082 _null_ _null_ )); DATA(insert OID = 0 ( max PGUID date_larger - - 1082 1082 0 1082 _null_ _null_ ));
DATA(insert OID = 0 ( max PGUID time_larger - - 1083 1083 0 1083 _null_ _null_ ));
DATA(insert OID = 0 ( max PGUID timetz_larger - - 1266 1266 0 1266 _null_ _null_ ));
DATA(insert OID = 0 ( max PGUID cashlarger - - 790 790 0 790 _null_ _null_ )); DATA(insert OID = 0 ( max PGUID cashlarger - - 790 790 0 790 _null_ _null_ ));
DATA(insert OID = 0 ( max PGUID timestamp_larger - - 1184 1184 0 1184 _null_ _null_ )); DATA(insert OID = 0 ( max PGUID timestamp_larger - - 1184 1184 0 1184 _null_ _null_ ));
DATA(insert OID = 0 ( max PGUID interval_larger - - 1186 1186 0 1186 _null_ _null_ )); DATA(insert OID = 0 ( max PGUID interval_larger - - 1186 1186 0 1186 _null_ _null_ ));
...@@ -127,6 +129,8 @@ DATA(insert OID = 0 ( min PGUID float4smaller - - 700 700 0 700 _null_ _null ...@@ -127,6 +129,8 @@ DATA(insert OID = 0 ( min PGUID float4smaller - - 700 700 0 700 _null_ _null
DATA(insert OID = 0 ( min PGUID float8smaller - - 701 701 0 701 _null_ _null_ )); DATA(insert OID = 0 ( min PGUID float8smaller - - 701 701 0 701 _null_ _null_ ));
DATA(insert OID = 0 ( min PGUID int4smaller - - 702 702 0 702 _null_ _null_ )); DATA(insert OID = 0 ( min PGUID int4smaller - - 702 702 0 702 _null_ _null_ ));
DATA(insert OID = 0 ( min PGUID date_smaller - - 1082 1082 0 1082 _null_ _null_ )); DATA(insert OID = 0 ( min PGUID date_smaller - - 1082 1082 0 1082 _null_ _null_ ));
DATA(insert OID = 0 ( min PGUID time_smaller - - 1083 1083 0 1083 _null_ _null_ ));
DATA(insert OID = 0 ( min PGUID timetz_smaller - - 1266 1266 0 1266 _null_ _null_ ));
DATA(insert OID = 0 ( min PGUID cashsmaller - - 790 790 0 790 _null_ _null_ )); DATA(insert OID = 0 ( min PGUID cashsmaller - - 790 790 0 790 _null_ _null_ ));
DATA(insert OID = 0 ( min PGUID timestamp_smaller - - 1184 1184 0 1184 _null_ _null_ )); DATA(insert OID = 0 ( min PGUID timestamp_smaller - - 1184 1184 0 1184 _null_ _null_ ));
DATA(insert OID = 0 ( min PGUID interval_smaller - - 1186 1186 0 1186 _null_ _null_ )); DATA(insert OID = 0 ( min PGUID interval_smaller - - 1186 1186 0 1186 _null_ _null_ ));
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_amop.h,v 1.31 2000/02/27 12:02:33 wieck Exp $ * $Id: pg_amop.h,v 1.32 2000/03/14 23:06:43 thomas Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -285,7 +285,17 @@ DATA(insert OID = 0 ( 403 1115 1113 4 )); ...@@ -285,7 +285,17 @@ DATA(insert OID = 0 ( 403 1115 1113 4 ));
DATA(insert OID = 0 ( 403 1115 1112 5 )); DATA(insert OID = 0 ( 403 1115 1112 5 ));
/* /*
* nbtree datetime_ops * nbtree timetz_ops
*/
DATA(insert OID = 0 ( 403 1399 1552 1 ));
DATA(insert OID = 0 ( 403 1399 1553 2 ));
DATA(insert OID = 0 ( 403 1399 1550 3 ));
DATA(insert OID = 0 ( 403 1399 1555 4 ));
DATA(insert OID = 0 ( 403 1399 1554 5 ));
/*
* nbtree timestamp_ops
*/ */
DATA(insert OID = 0 ( 403 1312 1322 1 )); DATA(insert OID = 0 ( 403 1312 1322 1 ));
...@@ -295,7 +305,7 @@ DATA(insert OID = 0 ( 403 1312 1325 4 )); ...@@ -295,7 +305,7 @@ DATA(insert OID = 0 ( 403 1312 1325 4 ));
DATA(insert OID = 0 ( 403 1312 1324 5 )); DATA(insert OID = 0 ( 403 1312 1324 5 ));
/* /*
* nbtree timespan_ops * nbtree interval_ops
*/ */
DATA(insert OID = 0 ( 403 1313 1332 1 )); DATA(insert OID = 0 ( 403 1313 1332 1 ));
...@@ -397,9 +407,11 @@ DATA(insert OID = 0 ( 405 1077 1062 1 )); ...@@ -397,9 +407,11 @@ DATA(insert OID = 0 ( 405 1077 1062 1 ));
DATA(insert OID = 0 ( 405 1114 1093 1 )); DATA(insert OID = 0 ( 405 1114 1093 1 ));
/* time_ops */ /* time_ops */
DATA(insert OID = 0 ( 405 1115 1108 1 )); DATA(insert OID = 0 ( 405 1115 1108 1 ));
/* datetime_ops */ /* timetz_ops */
DATA(insert OID = 0 ( 405 1399 1550 1 ));
/* timestamp_ops */
DATA(insert OID = 0 ( 405 1312 1320 1 )); DATA(insert OID = 0 ( 405 1312 1320 1 ));
/* timespan_ops */ /* interval_ops */
DATA(insert OID = 0 ( 405 1313 1330 1 )); DATA(insert OID = 0 ( 405 1313 1330 1 ));
/* macaddr_ops */ /* macaddr_ops */
DATA(insert OID = 0 ( 405 810 1220 1 )); DATA(insert OID = 0 ( 405 810 1220 1 ));
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_amproc.h,v 1.21 2000/02/27 12:02:33 wieck Exp $ * $Id: pg_amproc.h,v 1.22 2000/03/14 23:06:43 thomas Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -101,6 +101,7 @@ DATA(insert OID = 0 (403 652 926 1)); ...@@ -101,6 +101,7 @@ DATA(insert OID = 0 (403 652 926 1));
DATA(insert OID = 0 (403 1768 1769 1)); DATA(insert OID = 0 (403 1768 1769 1));
DATA(insert OID = 0 (403 1690 1693 1)); DATA(insert OID = 0 (403 1690 1693 1));
DATA(insert OID = 0 (403 1663 1636 1)); DATA(insert OID = 0 (403 1663 1636 1));
DATA(insert OID = 0 (403 1399 1358 1));
...@@ -120,5 +121,6 @@ DATA(insert OID = 0 (405 1115 452 1)); ...@@ -120,5 +121,6 @@ DATA(insert OID = 0 (405 1115 452 1));
DATA(insert OID = 0 (405 1181 455 1)); DATA(insert OID = 0 (405 1181 455 1));
DATA(insert OID = 0 (405 1312 452 1)); DATA(insert OID = 0 (405 1312 452 1));
DATA(insert OID = 0 (405 1313 452 1)); DATA(insert OID = 0 (405 1313 452 1));
DATA(insert OID = 0 (405 1399 452 1));
#endif /* PG_AMPROC_H */ #endif /* PG_AMPROC_H */
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_opclass.h,v 1.30 2000/02/27 12:02:33 wieck Exp $ * $Id: pg_opclass.h,v 1.31 2000/03/14 23:06:43 thomas Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -122,5 +122,7 @@ DATA(insert OID = 1663 ( lztext_ops 1625 )); ...@@ -122,5 +122,7 @@ DATA(insert OID = 1663 ( lztext_ops 1625 ));
DESCR(""); DESCR("");
DATA(insert OID = 1690 ( bool_ops 16 )); DATA(insert OID = 1690 ( bool_ops 16 ));
DESCR(""); DESCR("");
DATA(insert OID = 1399 ( timetz_ops 1266 ));
DESCR("");
#endif /* PG_OPCLASS_H */ #endif /* PG_OPCLASS_H */
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_operator.h,v 1.71 2000/02/27 12:02:33 wieck Exp $ * $Id: pg_operator.h,v 1.72 2000/03/14 23:06:43 thomas Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -141,6 +141,8 @@ DATA(insert OID = 401 ( "=" PGUID 0 b t f 1034 1034 16 401 0 0 0 array_e ...@@ -141,6 +141,8 @@ DATA(insert OID = 401 ( "=" PGUID 0 b t f 1034 1034 16 401 0 0 0 array_e
DATA(insert OID = 387 ( "=" PGUID 0 b t t 27 27 16 387 0 0 0 tideq eqsel eqjoinsel )); DATA(insert OID = 387 ( "=" PGUID 0 b t t 27 27 16 387 0 0 0 tideq eqsel eqjoinsel ));
#define TIDEqualOperator 387 #define TIDEqualOperator 387
DATA(insert OID = 388 ( "!" PGUID 0 r t f 20 0 20 0 0 0 0 int8fac - - ));
DATA(insert OID = 389 ( "!!" PGUID 0 l t f 0 20 20 0 0 0 0 int8fac - - ));
DATA(insert OID = 410 ( "=" PGUID 0 b t t 20 20 16 410 411 412 412 int8eq eqsel eqjoinsel )); DATA(insert OID = 410 ( "=" PGUID 0 b t t 20 20 16 410 411 412 412 int8eq eqsel eqjoinsel ));
DATA(insert OID = 411 ( "<>" PGUID 0 b t f 20 20 16 411 410 0 0 int8ne neqsel neqjoinsel )); DATA(insert OID = 411 ( "<>" PGUID 0 b t f 20 20 16 411 410 0 0 int8ne neqsel neqjoinsel ));
...@@ -155,6 +157,8 @@ DATA(insert OID = 418 ( "<" PGUID 0 b t f 20 23 16 76 430 0 0 int84lt sc ...@@ -155,6 +157,8 @@ DATA(insert OID = 418 ( "<" PGUID 0 b t f 20 23 16 76 430 0 0 int84lt sc
DATA(insert OID = 419 ( ">" PGUID 0 b t f 20 23 16 37 420 0 0 int84gt scalargtsel scalargtjoinsel )); DATA(insert OID = 419 ( ">" PGUID 0 b t f 20 23 16 37 420 0 0 int84gt scalargtsel scalargtjoinsel ));
DATA(insert OID = 420 ( "<=" PGUID 0 b t f 20 23 16 82 419 0 0 int84le scalarltsel scalarltjoinsel )); DATA(insert OID = 420 ( "<=" PGUID 0 b t f 20 23 16 82 419 0 0 int84le scalarltsel scalarltjoinsel ));
DATA(insert OID = 430 ( ">=" PGUID 0 b t f 20 23 16 80 418 0 0 int84ge scalargtsel scalargtjoinsel )); DATA(insert OID = 430 ( ">=" PGUID 0 b t f 20 23 16 80 418 0 0 int84ge scalargtsel scalargtjoinsel ));
DATA(insert OID = 439 ( "%" PGUID 0 b t f 20 20 20 0 0 0 0 int8mod - - ));
DATA(insert OID = 473 ( "@" PGUID 0 l t f 0 20 20 0 0 0 0 int8abs - - ));
DATA(insert OID = 484 ( "-" PGUID 0 l t f 0 20 20 0 0 0 0 int8um - - )); DATA(insert OID = 484 ( "-" PGUID 0 l t f 0 20 20 0 0 0 0 int8um - - ));
DATA(insert OID = 485 ( "<<" PGUID 0 b t f 604 604 16 0 0 0 0 poly_left positionsel positionjoinsel )); DATA(insert OID = 485 ( "<<" PGUID 0 b t f 604 604 16 0 0 0 0 poly_left positionsel positionjoinsel ));
...@@ -344,6 +348,7 @@ DATA(insert OID = 673 ( "<=" PGUID 0 b t f 701 701 16 675 674 0 0 float8le ...@@ -344,6 +348,7 @@ DATA(insert OID = 673 ( "<=" PGUID 0 b t f 701 701 16 675 674 0 0 float8le
DATA(insert OID = 674 ( ">" PGUID 0 b t f 701 701 16 672 673 0 0 float8gt scalargtsel scalargtjoinsel )); DATA(insert OID = 674 ( ">" PGUID 0 b t f 701 701 16 672 673 0 0 float8gt scalargtsel scalargtjoinsel ));
DATA(insert OID = 675 ( ">=" PGUID 0 b t f 701 701 16 673 672 0 0 float8ge scalargtsel scalargtjoinsel )); DATA(insert OID = 675 ( ">=" PGUID 0 b t f 701 701 16 673 672 0 0 float8ge scalargtsel scalargtjoinsel ));
DATA(insert OID = 682 ( "@" PGUID 0 l t f 0 21 21 0 0 0 0 int2abs - - ));
DATA(insert OID = 684 ( "+" PGUID 0 b t f 20 20 20 684 0 0 0 int8pl - - )); DATA(insert OID = 684 ( "+" PGUID 0 b t f 20 20 20 684 0 0 0 int8pl - - ));
DATA(insert OID = 685 ( "-" PGUID 0 b t f 20 20 20 0 0 0 0 int8mi - - )); DATA(insert OID = 685 ( "-" PGUID 0 b t f 20 20 20 0 0 0 0 int8mi - - ));
DATA(insert OID = 686 ( "*" PGUID 0 b t f 20 20 20 686 0 0 0 int8mul - - )); DATA(insert OID = 686 ( "*" PGUID 0 b t f 20 20 20 686 0 0 0 int8mul - - ));
...@@ -379,6 +384,8 @@ DATA(insert OID = 757 ( "~" PGUID 0 b t f 604 600 16 756 0 0 0 poly_con ...@@ -379,6 +384,8 @@ DATA(insert OID = 757 ( "~" PGUID 0 b t f 604 600 16 756 0 0 0 poly_con
DATA(insert OID = 758 ( "@" PGUID 0 b t f 600 718 16 759 0 0 0 pt_contained_circle - - )); DATA(insert OID = 758 ( "@" PGUID 0 b t f 600 718 16 759 0 0 0 pt_contained_circle - - ));
DATA(insert OID = 759 ( "~" PGUID 0 b t f 718 600 16 758 0 0 0 circle_contain_pt - - )); DATA(insert OID = 759 ( "~" PGUID 0 b t f 718 600 16 758 0 0 0 circle_contain_pt - - ));
DATA(insert OID = 773 ( "@" PGUID 0 l t f 0 23 23 0 0 0 0 int4abs - - ));
/* additional operators for geometric types - thomas 1997-07-09 */ /* additional operators for geometric types - thomas 1997-07-09 */
DATA(insert OID = 792 ( "=" PGUID 0 b t f 602 602 16 792 0 0 0 path_n_eq eqsel eqjoinsel )); DATA(insert OID = 792 ( "=" PGUID 0 b t f 602 602 16 792 0 0 0 path_n_eq eqsel eqjoinsel ));
DATA(insert OID = 793 ( "<" PGUID 0 b t f 602 602 16 794 0 0 0 path_n_lt - - )); DATA(insert OID = 793 ( "<" PGUID 0 b t f 602 602 16 794 0 0 0 path_n_lt - - ));
...@@ -480,6 +487,14 @@ DATA(insert OID = 1111 ( "<=" PGUID 0 b t f 1083 1083 16 1113 1112 0 0 time ...@@ -480,6 +487,14 @@ DATA(insert OID = 1111 ( "<=" PGUID 0 b t f 1083 1083 16 1113 1112 0 0 time
DATA(insert OID = 1112 ( ">" PGUID 0 b t f 1083 1083 16 1110 1111 0 0 time_gt scalargtsel scalargtjoinsel )); DATA(insert OID = 1112 ( ">" PGUID 0 b t f 1083 1083 16 1110 1111 0 0 time_gt scalargtsel scalargtjoinsel ));
DATA(insert OID = 1113 ( ">=" PGUID 0 b t f 1083 1083 16 1111 1110 0 0 time_ge scalargtsel scalargtjoinsel )); DATA(insert OID = 1113 ( ">=" PGUID 0 b t f 1083 1083 16 1111 1110 0 0 time_ge scalargtsel scalargtjoinsel ));
/* timetz operators */
DATA(insert OID = 1550 ( "=" PGUID 0 b t f 1266 1266 16 1550 1551 1552 1552 timetz_eq eqsel eqjoinsel ));
DATA(insert OID = 1551 ( "<>" PGUID 0 b t f 1266 1266 16 1551 1550 0 0 timetz_ne neqsel neqjoinsel ));
DATA(insert OID = 1552 ( "<" PGUID 0 b t f 1266 1266 16 1554 1555 0 0 timetz_lt scalarltsel scalarltjoinsel ));
DATA(insert OID = 1553 ( "<=" PGUID 0 b t f 1266 1266 16 1555 1554 0 0 timetz_le scalarltsel scalarltjoinsel ));
DATA(insert OID = 1554 ( ">" PGUID 0 b t f 1266 1266 16 1552 1553 0 0 timetz_gt scalargtsel scalargtjoinsel ));
DATA(insert OID = 1555 ( ">=" PGUID 0 b t f 1266 1266 16 1553 1552 0 0 timetz_ge scalargtsel scalargtjoinsel ));
/* float48 operators */ /* float48 operators */
DATA(insert OID = 1116 ( "+" PGUID 0 b t f 700 701 701 1126 0 0 0 float48pl - - )); DATA(insert OID = 1116 ( "+" PGUID 0 b t f 700 701 701 1126 0 0 0 float48pl - - ));
DATA(insert OID = 1117 ( "-" PGUID 0 b t f 700 701 701 0 0 0 0 float48mi - - )); DATA(insert OID = 1117 ( "-" PGUID 0 b t f 700 701 701 0 0 0 0 float48mi - - ));
...@@ -508,6 +523,9 @@ DATA(insert OID = 1135 ( ">=" PGUID 0 b t f 701 700 16 1124 1132 0 0 float8 ...@@ -508,6 +523,9 @@ DATA(insert OID = 1135 ( ">=" PGUID 0 b t f 701 700 16 1124 1132 0 0 float8
DATA(insert OID = 1136 ( "=" PGUID 0 b t t 23 26 16 1137 0 0 0 int4eqoid eqsel eqjoinsel )); DATA(insert OID = 1136 ( "=" PGUID 0 b t t 23 26 16 1137 0 0 0 int4eqoid eqsel eqjoinsel ));
DATA(insert OID = 1137 ( "=" PGUID 0 b t t 26 23 16 1136 0 0 0 oideqint4 eqsel eqjoinsel )); DATA(insert OID = 1137 ( "=" PGUID 0 b t t 26 23 16 1136 0 0 0 oideqint4 eqsel eqjoinsel ));
DATA(insert OID = 1158 ( "!" PGUID 0 r t f 21 0 23 0 0 0 0 int2fac - - ));
DATA(insert OID = 1175 ( "!!" PGUID 0 l t f 0 21 23 0 0 0 0 int2fac - - ));
/* LIKE hacks by Keith Parks. */ /* LIKE hacks by Keith Parks. */
DATA(insert OID = 1207 ( "~~" PGUID 0 b t f 19 25 16 0 1208 0 0 namelike eqsel eqjoinsel )); DATA(insert OID = 1207 ( "~~" PGUID 0 b t f 19 25 16 0 1208 0 0 namelike eqsel eqjoinsel ));
#define OID_NAME_LIKE_OP 1207 #define OID_NAME_LIKE_OP 1207
...@@ -544,7 +562,6 @@ DATA(insert OID = 1322 ( "<" PGUID 0 b t f 1184 1184 16 1324 1325 0 0 times ...@@ -544,7 +562,6 @@ DATA(insert OID = 1322 ( "<" PGUID 0 b t f 1184 1184 16 1324 1325 0 0 times
DATA(insert OID = 1323 ( "<=" PGUID 0 b t f 1184 1184 16 1325 1324 0 0 timestamp_le scalarltsel scalarltjoinsel )); DATA(insert OID = 1323 ( "<=" PGUID 0 b t f 1184 1184 16 1325 1324 0 0 timestamp_le scalarltsel scalarltjoinsel ));
DATA(insert OID = 1324 ( ">" PGUID 0 b t f 1184 1184 16 1322 1323 0 0 timestamp_gt scalargtsel scalargtjoinsel )); DATA(insert OID = 1324 ( ">" PGUID 0 b t f 1184 1184 16 1322 1323 0 0 timestamp_gt scalargtsel scalargtjoinsel ));
DATA(insert OID = 1325 ( ">=" PGUID 0 b t f 1184 1184 16 1323 1322 0 0 timestamp_ge scalargtsel scalargtjoinsel )); DATA(insert OID = 1325 ( ">=" PGUID 0 b t f 1184 1184 16 1323 1322 0 0 timestamp_ge scalargtsel scalargtjoinsel ));
DATA(insert OID = 1327 ( "+" PGUID 0 b t f 1184 1186 1184 0 0 0 0 timestamp_pl_span - - )); DATA(insert OID = 1327 ( "+" PGUID 0 b t f 1184 1186 1184 0 0 0 0 timestamp_pl_span - - ));
DATA(insert OID = 1328 ( "-" PGUID 0 b t f 1184 1184 1186 0 0 0 0 timestamp_mi - - )); DATA(insert OID = 1328 ( "-" PGUID 0 b t f 1184 1184 1186 0 0 0 0 timestamp_mi - - ));
DATA(insert OID = 1329 ( "-" PGUID 0 b t f 1184 1186 1184 0 0 0 0 timestamp_mi_span - - )); DATA(insert OID = 1329 ( "-" PGUID 0 b t f 1184 1186 1184 0 0 0 0 timestamp_mi_span - - ));
...@@ -561,6 +578,11 @@ DATA(insert OID = 1336 ( "-" PGUID 0 l t f 0 1186 1186 0 0 0 0 interval_u ...@@ -561,6 +578,11 @@ DATA(insert OID = 1336 ( "-" PGUID 0 l t f 0 1186 1186 0 0 0 0 interval_u
DATA(insert OID = 1337 ( "+" PGUID 0 b t f 1186 1186 1186 1337 0 0 0 interval_pl - - )); DATA(insert OID = 1337 ( "+" PGUID 0 b t f 1186 1186 1186 1337 0 0 0 interval_pl - - ));
DATA(insert OID = 1338 ( "-" PGUID 0 b t f 1186 1186 1186 0 0 0 0 interval_mi - - )); DATA(insert OID = 1338 ( "-" PGUID 0 b t f 1186 1186 1186 0 0 0 0 interval_mi - - ));
DATA(insert OID = 1360 ( "+" PGUID 0 b t f 1082 1083 1184 0 0 0 0 datetime_pl - - ));
DATA(insert OID = 1361 ( "+" PGUID 0 b t f 1082 1266 1184 0 0 0 0 datetimetz_pl - - ));
DATA(insert OID = 1363 ( "+" PGUID 0 b t f 1083 1082 1184 0 0 0 0 timedate_pl - - ));
DATA(insert OID = 1366 ( "+" PGUID 0 b t f 1266 1082 1184 0 0 0 0 timetzdate_pl - - ));
/* additional geometric operators - thomas 97/04/18 */ /* additional geometric operators - thomas 97/04/18 */
DATA(insert OID = 1420 ( "@@" PGUID 0 l t f 0 718 600 0 0 0 0 circle_center - - )); DATA(insert OID = 1420 ( "@@" PGUID 0 l t f 0 718 600 0 0 0 0 circle_center - - ));
DATA(insert OID = 1500 ( "=" PGUID 0 b t f 718 718 16 1500 1501 1502 1502 circle_eq eqsel eqjoinsel )); DATA(insert OID = 1500 ( "=" PGUID 0 b t f 718 718 16 1500 1501 1502 1502 circle_eq eqsel eqjoinsel ));
...@@ -670,6 +692,7 @@ DATA(insert OID = 828 ( ">>" PGUID 0 b t f 650 650 16 826 0 0 0 network_s ...@@ -670,6 +692,7 @@ DATA(insert OID = 828 ( ">>" PGUID 0 b t f 650 650 16 826 0 0 0 network_s
DATA(insert OID = 1004 ( ">>=" PGUID 0 b t f 650 650 16 827 0 0 0 network_supeq - - )); DATA(insert OID = 1004 ( ">>=" PGUID 0 b t f 650 650 16 827 0 0 0 network_supeq - - ));
/* NUMERIC type - OID's 1700-1799 */ /* NUMERIC type - OID's 1700-1799 */
DATA(insert OID = 1751 ( "-" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_uminus - - ));
DATA(insert OID = 1752 ( "=" PGUID 0 b t f 1700 1700 16 1752 1753 1754 1754 numeric_eq eqsel eqjoinsel )); DATA(insert OID = 1752 ( "=" PGUID 0 b t f 1700 1700 16 1752 1753 1754 1754 numeric_eq eqsel eqjoinsel ));
DATA(insert OID = 1753 ( "<>" PGUID 0 b t f 1700 1700 16 1753 1752 0 0 numeric_ne neqsel neqjoinsel )); DATA(insert OID = 1753 ( "<>" PGUID 0 b t f 1700 1700 16 1753 1752 0 0 numeric_ne neqsel neqjoinsel ));
DATA(insert OID = 1754 ( "<" PGUID 0 b t f 1700 1700 16 1756 1757 0 0 numeric_lt scalarltsel scalarltjoinsel )); DATA(insert OID = 1754 ( "<" PGUID 0 b t f 1700 1700 16 1756 1757 0 0 numeric_lt scalarltsel scalarltjoinsel ));
...@@ -682,7 +705,6 @@ DATA(insert OID = 1760 ( "*" PGUID 0 b t f 1700 1700 1700 1760 0 0 0 numeric ...@@ -682,7 +705,6 @@ DATA(insert OID = 1760 ( "*" PGUID 0 b t f 1700 1700 1700 1760 0 0 0 numeric
DATA(insert OID = 1761 ( "/" PGUID 0 b t f 1700 1700 1700 0 0 0 0 numeric_div - - )); DATA(insert OID = 1761 ( "/" PGUID 0 b t f 1700 1700 1700 0 0 0 0 numeric_div - - ));
DATA(insert OID = 1762 ( "%" PGUID 0 b t f 1700 1700 1700 0 0 0 0 numeric_mod - - )); DATA(insert OID = 1762 ( "%" PGUID 0 b t f 1700 1700 1700 0 0 0 0 numeric_mod - - ));
DATA(insert OID = 1763 ( "@" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_abs - - )); DATA(insert OID = 1763 ( "@" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_abs - - ));
DATA(insert OID = 1788 ( "-" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_uminus - - ));
/* LZTEXT type */ /* LZTEXT type */
DATA(insert OID = 1657 ( "=" PGUID 0 b t f 1625 1625 16 1657 1658 1659 1659 lztext_eq eqsel eqjoinsel )); DATA(insert OID = 1657 ( "=" PGUID 0 b t f 1625 1625 16 1657 1658 1659 1659 lztext_eq eqsel eqjoinsel ));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_proc.h,v 1.126 2000/02/27 12:02:33 wieck Exp $ * $Id: pg_proc.h,v 1.127 2000/03/14 23:06:44 thomas Exp $
* *
* NOTES * NOTES
* The script catalog/genbki.sh reads this file and generates .bki * The script catalog/genbki.sh reads this file and generates .bki
...@@ -204,8 +204,6 @@ DATA(insert OID = 1257 ( textlen PGUID 11 f t t 1 f 23 "25" 100 0 1 0 text ...@@ -204,8 +204,6 @@ DATA(insert OID = 1257 ( textlen PGUID 11 f t t 1 f 23 "25" 100 0 1 0 text
DESCR("length"); DESCR("length");
DATA(insert OID = 1258 ( textcat PGUID 11 f t t 2 f 25 "25 25" 100 0 1 0 textcat - )); DATA(insert OID = 1258 ( textcat PGUID 11 f t t 2 f 25 "25 25" 100 0 1 0 textcat - ));
DESCR("concatenate"); DESCR("concatenate");
DATA(insert OID = 1377 ( textoctetlen PGUID 11 f t t 1 f 23 "25" 100 0 1 0 textoctetlen - ));
DESCR("octet length");
DATA(insert OID = 84 ( boolne PGUID 11 f t t 2 f 16 "16 16" 100 0 0 100 boolne - )); DATA(insert OID = 84 ( boolne PGUID 11 f t t 2 f 16 "16 16" 100 0 0 100 boolne - ));
DESCR("not equal"); DESCR("not equal");
...@@ -219,7 +217,9 @@ DESCR("btree cost estimator"); ...@@ -219,7 +217,9 @@ DESCR("btree cost estimator");
/* OIDS 100 - 199 */ /* OIDS 100 - 199 */
DATA(insert OID = 1272 ( eqsel PGUID 11 f t f 5 f 701 "26 26 21 0 23" 100 0 0 100 eqsel - )); DATA(insert OID = 100 ( int8fac PGUID 11 f t t 1 f 20 "20" 100 0 0 100 int8fac - ));
DESCR("factorial");
DATA(insert OID = 101 ( eqsel PGUID 11 f t f 5 f 701 "26 26 21 0 23" 100 0 0 100 eqsel - ));
DESCR("restriction selectivity of = and related operators"); DESCR("restriction selectivity of = and related operators");
DATA(insert OID = 102 ( neqsel PGUID 11 f t f 5 f 701 "26 26 21 0 23" 100 0 0 100 neqsel - )); DATA(insert OID = 102 ( neqsel PGUID 11 f t f 5 f 701 "26 26 21 0 23" 100 0 0 100 neqsel - ));
DESCR("restriction selectivity of <> and related operators"); DESCR("restriction selectivity of <> and related operators");
...@@ -236,11 +236,11 @@ DESCR("join selectivity of < and related operators on scalar datatypes"); ...@@ -236,11 +236,11 @@ DESCR("join selectivity of < and related operators on scalar datatypes");
DATA(insert OID = 108 ( scalargtjoinsel PGUID 11 f t f 5 f 701 "26 26 21 26 21" 100 0 0 100 scalargtjoinsel - )); DATA(insert OID = 108 ( scalargtjoinsel PGUID 11 f t f 5 f 701 "26 26 21 26 21" 100 0 0 100 scalargtjoinsel - ));
DESCR("join selectivity of > and related operators on scalar datatypes"); DESCR("join selectivity of > and related operators on scalar datatypes");
DATA(insert OID = 112 ( int4_text PGUID 11 f t t 1 f 25 "23" 100 0 0 100 int4_text - )); DATA(insert OID = 112 ( text PGUID 11 f t t 1 f 25 "23" 100 0 0 100 int4_text - ));
DESCR("convert int4 to text"); DESCR("convert int4 to text");
DATA(insert OID = 113 ( int2_text PGUID 11 f t t 1 f 25 "21" 100 0 0 100 int2_text - )); DATA(insert OID = 113 ( text PGUID 11 f t t 1 f 25 "21" 100 0 0 100 int2_text - ));
DESCR("convert int2 to text"); DESCR("convert int2 to text");
DATA(insert OID = 114 ( oid_text PGUID 11 f t t 1 f 25 "26" 100 0 0 100 oid_text - )); DATA(insert OID = 114 ( text PGUID 11 f t t 1 f 25 "26" 100 0 0 100 oid_text - ));
DESCR("convert oid to text"); DESCR("convert oid to text");
DATA(insert OID = 115 ( box_above PGUID 11 f t t 2 f 16 "603 603" 100 1 0 100 box_above - )); DATA(insert OID = 115 ( box_above PGUID 11 f t t 2 f 16 "603 603" 100 1 0 100 box_above - ));
...@@ -299,7 +299,7 @@ DESCR("join selectivity for area-comparison operators"); ...@@ -299,7 +299,7 @@ DESCR("join selectivity for area-comparison operators");
DATA(insert OID = 141 ( int4mul PGUID 11 f t t 2 f 23 "23 23" 100 0 0 100 int4mul - )); DATA(insert OID = 141 ( int4mul PGUID 11 f t t 2 f 23 "23 23" 100 0 0 100 int4mul - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 142 ( int4fac PGUID 11 f t t 1 f 23 "23" 100 0 0 100 int4fac - )); DATA(insert OID = 142 ( int4fac PGUID 11 f t t 1 f 23 "23" 100 0 0 100 int4fac - ));
DESCR("fraction"); DESCR("factorial");
DATA(insert OID = 143 ( pointdist PGUID 11 f t t 2 f 23 "600 600" 100 0 0 100 pointdist - )); DATA(insert OID = 143 ( pointdist PGUID 11 f t t 2 f 23 "600 600" 100 0 0 100 pointdist - ));
DESCR(""); DESCR("");
DATA(insert OID = 144 ( int4ne PGUID 11 f t t 2 f 16 "23 23" 100 0 0 100 int4ne - )); DATA(insert OID = 144 ( int4ne PGUID 11 f t t 2 f 16 "23 23" 100 0 0 100 int4ne - ));
...@@ -476,7 +476,7 @@ DATA(insert OID = 227 ( poly_center PGUID 11 f t t 1 f 600 "604" 100 0 0 100 ...@@ -476,7 +476,7 @@ DATA(insert OID = 227 ( poly_center PGUID 11 f t t 1 f 600 "604" 100 0 0 100
DESCR("center of"); DESCR("center of");
DATA(insert OID = 228 ( dround PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dround - )); DATA(insert OID = 228 ( dround PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dround - ));
DESCR("truncate to integer"); DESCR("round to integer");
DATA(insert OID = 229 ( dtrunc PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dtrunc - )); DATA(insert OID = 229 ( dtrunc PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dtrunc - ));
DESCR("truncate to integer"); DESCR("truncate to integer");
DATA(insert OID = 230 ( dsqrt PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dsqrt - )); DATA(insert OID = 230 ( dsqrt PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dsqrt - ));
...@@ -484,19 +484,19 @@ DESCR("square root"); ...@@ -484,19 +484,19 @@ DESCR("square root");
DATA(insert OID = 231 ( dcbrt PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dcbrt - )); DATA(insert OID = 231 ( dcbrt PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dcbrt - ));
DESCR("cube root"); DESCR("cube root");
DATA(insert OID = 232 ( dpow PGUID 11 f t t 2 f 701 "701 701" 100 0 0 100 dpow - )); DATA(insert OID = 232 ( dpow PGUID 11 f t t 2 f 701 "701 701" 100 0 0 100 dpow - ));
DESCR("exponentiation"); DESCR("exponential (x^y)");
DATA(insert OID = 233 ( dexp PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dexp - )); DATA(insert OID = 233 ( dexp PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dexp - ));
DESCR("exponential"); DESCR("natural exponential (e^x)");
DATA(insert OID = 234 ( dlog1 PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dlog1 - )); DATA(insert OID = 234 ( dlog1 PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dlog1 - ));
DESCR("natural logarithm (in psql, protect with ()"); DESCR("natural logarithm");
DATA(insert OID = 235 ( i2tod PGUID 11 f t t 1 f 701 "21" 100 0 0 100 i2tod - )); DATA(insert OID = 235 ( float8 PGUID 11 f t t 1 f 701 "21" 100 0 0 100 i2tod - ));
DESCR("convert int2 to float8"); DESCR("convert int2 to float8");
DATA(insert OID = 236 ( i2tof PGUID 11 f t t 1 f 700 "21" 100 0 0 100 i2tof - )); DATA(insert OID = 236 ( float4 PGUID 11 f t t 1 f 700 "21" 100 0 0 100 i2tof - ));
DESCR("convert int2 to float4"); DESCR("convert int2 to float4");
DATA(insert OID = 237 ( dtoi2 PGUID 11 f t t 1 f 21 "701" 100 0 0 100 dtoi2 - )); DATA(insert OID = 237 ( int2 PGUID 11 f t t 1 f 21 "701" 100 0 0 100 dtoi2 - ));
DESCR("convert float8 to int2"); DESCR("convert float8 to int2");
DATA(insert OID = 238 ( ftoi2 PGUID 11 f t t 1 f 21 "700" 100 0 0 100 ftoi2 - )); DATA(insert OID = 238 ( int2 PGUID 11 f t t 1 f 21 "700" 100 0 0 100 ftoi2 - ));
DESCR("convert float4 to int2"); DESCR("convert float4 to int2");
DATA(insert OID = 239 ( line_distance PGUID 11 f t t 2 f 701 "628 628" 100 0 0 100 line_distance - )); DATA(insert OID = 239 ( line_distance PGUID 11 f t t 2 f 701 "628 628" 100 0 0 100 line_distance - ));
DESCR("distance between"); DESCR("distance between");
...@@ -522,7 +522,7 @@ DESCR("abstime in tinterval"); ...@@ -522,7 +522,7 @@ DESCR("abstime in tinterval");
DATA(insert OID = 249 ( tintervalrel PGUID 11 f t f 1 f 703 "704" 100 0 0 100 tintervalrel - )); DATA(insert OID = 249 ( tintervalrel PGUID 11 f t f 1 f 703 "704" 100 0 0 100 tintervalrel - ));
DESCR(""); DESCR("");
DATA(insert OID = 250 ( timenow PGUID 11 f t f 0 f 702 "0" 100 0 0 100 timenow - )); DATA(insert OID = 250 ( timenow PGUID 11 f t f 0 f 702 "0" 100 0 0 100 timenow - ));
DESCR("Current date and time"); DESCR("Current date and time (abstime)");
DATA(insert OID = 251 ( abstimeeq PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 abstimeeq - )); DATA(insert OID = 251 ( abstimeeq PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 abstimeeq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 252 ( abstimene PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 abstimene - )); DATA(insert OID = 252 ( abstimene PGUID 11 f t f 2 f 16 "702 702" 100 0 0 100 abstimene - ));
...@@ -571,10 +571,10 @@ DATA(insert OID = 273 ( tintervalend PGUID 11 f t f 1 f 702 "704" 100 0 0 10 ...@@ -571,10 +571,10 @@ DATA(insert OID = 273 ( tintervalend PGUID 11 f t f 1 f 702 "704" 100 0 0 10
DESCR(""); DESCR("");
DATA(insert OID = 274 ( timeofday PGUID 11 f t f 0 f 25 "0" 100 0 0 100 timeofday - )); DATA(insert OID = 274 ( timeofday PGUID 11 f t f 0 f 25 "0" 100 0 0 100 timeofday - ));
DESCR("Current date and time with microseconds"); DESCR("Current date and time with microseconds");
DATA(insert OID = 275 ( abstime_finite PGUID 11 f t f 1 f 16 "702" 100 0 0 100 abstime_finite - )); DATA(insert OID = 275 ( isfinite PGUID 11 f t f 1 f 16 "702" 100 0 0 100 abstime_finite - ));
DESCR(""); DESCR("");
DATA(insert OID = 276 ( int2fac PGUID 11 f t t 1 f 21 "21" 100 0 0 100 int2fac - )); DATA(insert OID = 276 ( int2fac PGUID 11 f t t 1 f 23 "21" 100 0 0 100 int2fac - ));
DESCR(""); DESCR("");
DATA(insert OID = 277 ( inter_sl PGUID 11 f t t 2 f 16 "601 628" 100 0 0 100 inter_sl - )); DATA(insert OID = 277 ( inter_sl PGUID 11 f t t 2 f 16 "601 628" 100 0 0 100 inter_sl - ));
...@@ -653,23 +653,23 @@ DESCR("greater-than"); ...@@ -653,23 +653,23 @@ DESCR("greater-than");
DATA(insert OID = 310 ( float84ge PGUID 11 f t t 2 f 16 "701 700" 100 0 0 100 float84ge - )); DATA(insert OID = 310 ( float84ge PGUID 11 f t t 2 f 16 "701 700" 100 0 0 100 float84ge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 311 ( ftod PGUID 11 f t t 1 f 701 "700" 100 0 0 100 ftod - )); DATA(insert OID = 311 ( float8 PGUID 11 f t t 1 f 701 "700" 100 0 0 100 ftod - ));
DESCR("convert float4 to float8"); DESCR("convert float4 to float8");
DATA(insert OID = 312 ( dtof PGUID 11 f t t 1 f 700 "701" 100 0 0 100 dtof - )); DATA(insert OID = 312 ( float4 PGUID 11 f t t 1 f 700 "701" 100 0 0 100 dtof - ));
DESCR("convert float8 to float4"); DESCR("convert float8 to float4");
DATA(insert OID = 313 ( i2toi4 PGUID 11 f t t 1 f 23 "21" 100 0 0 100 i2toi4 - )); DATA(insert OID = 313 ( int4 PGUID 11 f t t 1 f 23 "21" 100 0 0 100 i2toi4 - ));
DESCR("convert int2 to int4"); DESCR("convert int2 to int4");
DATA(insert OID = 314 ( i4toi2 PGUID 11 f t t 1 f 21 "23" 100 0 0 100 i4toi2 - )); DATA(insert OID = 314 ( int2 PGUID 11 f t t 1 f 21 "23" 100 0 0 100 i4toi2 - ));
DESCR("convert int4 to int2"); DESCR("convert int4 to int2");
DATA(insert OID = 315 ( int2vectoreq PGUID 11 f t t 2 f 16 "22 22" 100 0 0 100 int2vectoreq - )); DATA(insert OID = 315 ( int2vectoreq PGUID 11 f t t 2 f 16 "22 22" 100 0 0 100 int2vectoreq - ));
DESCR("equal"); DESCR("equal");
DATA(insert OID = 316 ( i4tod PGUID 11 f t t 1 f 701 "23" 100 0 0 100 i4tod - )); DATA(insert OID = 316 ( float8 PGUID 11 f t t 1 f 701 "23" 100 0 0 100 i4tod - ));
DESCR("convert int4 to float8"); DESCR("convert int4 to float8");
DATA(insert OID = 317 ( dtoi4 PGUID 11 f t t 1 f 23 "701" 100 0 0 100 dtoi4 - )); DATA(insert OID = 317 ( int4 PGUID 11 f t t 1 f 23 "701" 100 0 0 100 dtoi4 - ));
DESCR("convert float8 to int4"); DESCR("convert float8 to int4");
DATA(insert OID = 318 ( i4tof PGUID 11 f t t 1 f 700 "23" 100 0 0 100 i4tof - )); DATA(insert OID = 318 ( float4 PGUID 11 f t t 1 f 700 "23" 100 0 0 100 i4tof - ));
DESCR("convert int4 to float4"); DESCR("convert int4 to float4");
DATA(insert OID = 319 ( ftoi4 PGUID 11 f t t 1 f 23 "700" 100 0 0 100 ftoi4 - )); DATA(insert OID = 319 ( int4 PGUID 11 f t t 1 f 23 "700" 100 0 0 100 ftoi4 - ));
DESCR("convert float4 to int4"); DESCR("convert float4 to int4");
DATA(insert OID = 320 ( rtinsert PGUID 11 f t f 5 f 23 "0" 100 0 0 100 rtinsert - )); DATA(insert OID = 320 ( rtinsert PGUID 11 f t f 5 f 23 "0" 100 0 0 100 rtinsert - ));
...@@ -765,9 +765,9 @@ DESCR(""); ...@@ -765,9 +765,9 @@ DESCR("");
DATA(insert OID = 363 ( dist_ps PGUID 11 f t t 2 f 701 "600 601" 100 0 0 100 dist_ps - )); DATA(insert OID = 363 ( dist_ps PGUID 11 f t t 2 f 701 "600 601" 100 0 0 100 dist_ps - ));
DESCR("distance between"); DESCR("distance between");
DATA(insert OID = 364 ( dist_pb PGUID 11 f t t 2 f 701 "600 603" 100 0 0 100 dist_pb - )); DATA(insert OID = 364 ( dist_pb PGUID 11 f t t 2 f 701 "600 603" 100 0 0 100 dist_pb - ));
DESCR("distance between"); DESCR("distance between point and box");
DATA(insert OID = 365 ( dist_sb PGUID 11 f t t 2 f 701 "601 603" 100 0 0 100 dist_sb - )); DATA(insert OID = 365 ( dist_sb PGUID 11 f t t 2 f 701 "601 603" 100 0 0 100 dist_sb - ));
DESCR("distance between"); DESCR("distance between segment and box");
DATA(insert OID = 366 ( close_ps PGUID 11 f t t 2 f 600 "600 601" 100 0 0 100 close_ps - )); DATA(insert OID = 366 ( close_ps PGUID 11 f t t 2 f 600 "600 601" 100 0 0 100 close_ps - ));
DESCR("closest point on line segment"); DESCR("closest point on line segment");
DATA(insert OID = 367 ( close_pb PGUID 11 f t t 2 f 600 "600 603" 100 0 0 100 close_pb - )); DATA(insert OID = 367 ( close_pb PGUID 11 f t t 2 f 600 "600 603" 100 0 0 100 close_pb - ));
...@@ -775,25 +775,25 @@ DESCR("closest point on box"); ...@@ -775,25 +775,25 @@ DESCR("closest point on box");
DATA(insert OID = 368 ( close_sb PGUID 11 f t t 2 f 600 "601 603" 100 0 0 100 close_sb - )); DATA(insert OID = 368 ( close_sb PGUID 11 f t t 2 f 600 "601 603" 100 0 0 100 close_sb - ));
DESCR("closest point to line segment on box"); DESCR("closest point to line segment on box");
DATA(insert OID = 369 ( on_ps PGUID 11 f t t 2 f 16 "600 601" 100 0 0 100 on_ps - )); DATA(insert OID = 369 ( on_ps PGUID 11 f t t 2 f 16 "600 601" 100 0 0 100 on_ps - ));
DESCR("contained in"); DESCR("point contained in segment");
DATA(insert OID = 370 ( path_distance PGUID 11 f t t 2 f 701 "602 602" 100 0 1 0 path_distance - )); DATA(insert OID = 370 ( path_distance PGUID 11 f t t 2 f 701 "602 602" 100 0 1 0 path_distance - ));
DESCR("distance between"); DESCR("distance between paths");
DATA(insert OID = 371 ( dist_ppath PGUID 11 f t t 2 f 701 "600 602" 100 0 1 0 dist_ppath - )); DATA(insert OID = 371 ( dist_ppath PGUID 11 f t t 2 f 701 "600 602" 100 0 1 0 dist_ppath - ));
DESCR("distance between"); DESCR("distance between point and patch");
DATA(insert OID = 372 ( on_sb PGUID 11 f t t 2 f 16 "601 603" 100 0 0 100 on_sb - )); DATA(insert OID = 372 ( on_sb PGUID 11 f t t 2 f 16 "601 603" 100 0 0 100 on_sb - ));
DESCR("contained in"); DESCR("contained in");
DATA(insert OID = 373 ( inter_sb PGUID 11 f t t 2 f 16 "601 603" 100 0 0 100 inter_sb - )); DATA(insert OID = 373 ( inter_sb PGUID 11 f t t 2 f 16 "601 603" 100 0 0 100 inter_sb - ));
DESCR(""); DESCR("intersects?");
/* OIDS 400 - 499 */ /* OIDS 400 - 499 */
DATA(insert OID = 406 ( name_text PGUID 11 f t t 1 f 25 "19" 100 0 0 100 name_text - )); DATA(insert OID = 406 ( text PGUID 11 f t t 1 f 25 "19" 100 0 0 100 name_text - ));
DESCR("convert name to text"); DESCR("convert name to text");
DATA(insert OID = 407 ( text_name PGUID 11 f t t 1 f 19 "25" 100 0 0 100 text_name - )); DATA(insert OID = 407 ( name PGUID 11 f t t 1 f 19 "25" 100 0 0 100 text_name - ));
DESCR("convert text to name"); DESCR("convert text to name");
DATA(insert OID = 408 ( name_bpchar PGUID 11 f t t 1 f 1042 "19" 100 0 0 100 name_bpchar - )); DATA(insert OID = 408 ( bpchar PGUID 11 f t t 1 f 1042 "19" 100 0 0 100 name_bpchar - ));
DESCR("convert name to char()"); DESCR("convert name to char()");
DATA(insert OID = 409 ( bpchar_name PGUID 11 f t t 1 f 19 "1042" 100 0 0 100 bpchar_name - )); DATA(insert OID = 409 ( name PGUID 11 f t t 1 f 19 "1042" 100 0 0 100 bpchar_name - ));
DESCR("convert char() to name"); DESCR("convert char() to name");
DATA(insert OID = 438 ( hashcostestimate PGUID 11 f t f 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 hashcostestimate - )); DATA(insert OID = 438 ( hashcostestimate PGUID 11 f t f 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 hashcostestimate - ));
...@@ -882,13 +882,13 @@ DESCR("less-than-or-equal"); ...@@ -882,13 +882,13 @@ DESCR("less-than-or-equal");
DATA(insert OID = 479 ( int84ge PGUID 11 f t t 2 f 16 "20 23" 100 0 0 100 int84ge - )); DATA(insert OID = 479 ( int84ge PGUID 11 f t t 2 f 16 "20 23" 100 0 0 100 int84ge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 480 ( int84 PGUID 11 f t t 1 f 23 "20" 100 0 0 100 int84 - )); DATA(insert OID = 480 ( int4 PGUID 11 f t t 1 f 23 "20" 100 0 0 100 int84 - ));
DESCR("convert int8 to int4"); DESCR("convert int8 to int4");
DATA(insert OID = 481 ( int48 PGUID 11 f t t 1 f 20 "23" 100 0 0 100 int48 - )); DATA(insert OID = 481 ( int8 PGUID 11 f t t 1 f 20 "23" 100 0 0 100 int48 - ));
DESCR("convert int4 to int8"); DESCR("convert int4 to int8");
DATA(insert OID = 482 ( i8tod PGUID 11 f t t 1 f 701 "20" 100 0 0 100 i8tod - )); DATA(insert OID = 482 ( float8 PGUID 11 f t t 1 f 701 "20" 100 0 0 100 i8tod - ));
DESCR("convert int8 to float8"); DESCR("convert int8 to float8");
DATA(insert OID = 483 ( dtoi8 PGUID 11 f t t 1 f 20 "701" 100 0 0 100 dtoi8 - )); DATA(insert OID = 483 ( int8 PGUID 11 f t t 1 f 20 "701" 100 0 0 100 dtoi8 - ));
DESCR("convert float8 to int8"); DESCR("convert float8 to int8");
/* OIDS 500 - 599 */ /* OIDS 500 - 599 */
...@@ -960,11 +960,11 @@ DATA(insert OID = 724 ( byteaSetBit PGUID 11 f t t 3 f 17 "17 23 23" 100 0 0 ...@@ -960,11 +960,11 @@ DATA(insert OID = 724 ( byteaSetBit PGUID 11 f t t 3 f 17 "17 23 23" 100 0 0
DESCR(""); DESCR("");
DATA(insert OID = 725 ( dist_pl PGUID 11 f t t 2 f 701 "600 628" 100 0 0 100 dist_pl - )); DATA(insert OID = 725 ( dist_pl PGUID 11 f t t 2 f 701 "600 628" 100 0 0 100 dist_pl - ));
DESCR("distance between"); DESCR("distance between point and line");
DATA(insert OID = 726 ( dist_lb PGUID 11 f t t 2 f 701 "628 603" 100 0 0 100 dist_lb - )); DATA(insert OID = 726 ( dist_lb PGUID 11 f t t 2 f 701 "628 603" 100 0 0 100 dist_lb - ));
DESCR("distance between"); DESCR("distance between line and box");
DATA(insert OID = 727 ( dist_sl PGUID 11 f t t 2 f 701 "601 628" 100 0 0 100 dist_sl - )); DATA(insert OID = 727 ( dist_sl PGUID 11 f t t 2 f 701 "601 628" 100 0 0 100 dist_sl - ));
DESCR("distance between"); DESCR("distance between lseg and line");
DATA(insert OID = 728 ( dist_cpoly PGUID 11 f t t 2 f 701 "718 604" 100 0 0 100 dist_cpoly - )); DATA(insert OID = 728 ( dist_cpoly PGUID 11 f t t 2 f 701 "718 604" 100 0 0 100 dist_cpoly - ));
DESCR("distance between"); DESCR("distance between");
DATA(insert OID = 729 ( poly_distance PGUID 11 f t t 2 f 701 "604 604" 100 0 0 100 poly_distance - )); DATA(insert OID = 729 ( poly_distance PGUID 11 f t t 2 f 701 "604 604" 100 0 0 100 poly_distance - ));
...@@ -1067,20 +1067,20 @@ DESCR("greater-than-or-equal"); ...@@ -1067,20 +1067,20 @@ DESCR("greater-than-or-equal");
/* OIDS 800 - 899 */ /* OIDS 800 - 899 */
DATA(insert OID = 817 ( text_oid PGUID 11 f t t 1 f 26 "25" 100 0 0 100 text_oid -)); DATA(insert OID = 817 ( oid PGUID 11 f t t 1 f 26 "25" 100 0 0 100 text_oid -));
DESCR("convert text to oid"); DESCR("convert text to oid");
DATA(insert OID = 818 ( text_int2 PGUID 11 f t t 1 f 21 "25" 100 0 0 100 text_int2 -)); DATA(insert OID = 818 ( int2 PGUID 11 f t t 1 f 21 "25" 100 0 0 100 text_int2 -));
DESCR("convert text to int2"); DESCR("convert text to int2");
DATA(insert OID = 819 ( text_int4 PGUID 11 f t t 1 f 23 "25" 100 0 0 100 text_int4 -)); DATA(insert OID = 819 ( int4 PGUID 11 f t t 1 f 23 "25" 100 0 0 100 text_int4 -));
DESCR("convert text to int4"); DESCR("convert text to int4");
DATA(insert OID = 838 ( text_float8 PGUID 11 f t t 1 f 701 "25" 100 0 0 100 text_float8 -)); DATA(insert OID = 838 ( float8 PGUID 11 f t t 1 f 701 "25" 100 0 0 100 text_float8 -));
DESCR("convert text to float8"); DESCR("convert text to float8");
DATA(insert OID = 839 ( text_float4 PGUID 11 f t t 1 f 700 "25" 100 0 0 100 text_float4 -)); DATA(insert OID = 839 ( float4 PGUID 11 f t t 1 f 700 "25" 100 0 0 100 text_float4 -));
DESCR("convert text to float4"); DESCR("convert text to float4");
DATA(insert OID = 840 ( float8_text PGUID 11 f t t 1 f 25 "701" 100 0 0 100 float8_text -)); DATA(insert OID = 840 ( text PGUID 11 f t t 1 f 25 "701" 100 0 0 100 float8_text -));
DESCR("convert float8 to text"); DESCR("convert float8 to text");
DATA(insert OID = 841 ( float4_text PGUID 11 f t t 1 f 25 "700" 100 0 0 100 float4_text -)); DATA(insert OID = 841 ( text PGUID 11 f t t 1 f 25 "700" 100 0 0 100 float4_text -));
DESCR("convert float4 to text"); DESCR("convert float4 to text");
DATA(insert OID = 846 ( cash_mul_flt4 PGUID 11 f t t 2 f 790 "790 700" 100 0 0 100 cash_mul_flt4 - )); DATA(insert OID = 846 ( cash_mul_flt4 PGUID 11 f t t 2 f 790 "790 700" 100 0 0 100 cash_mul_flt4 - ));
...@@ -1090,7 +1090,7 @@ DESCR("divide"); ...@@ -1090,7 +1090,7 @@ DESCR("divide");
DATA(insert OID = 848 ( flt4_mul_cash PGUID 11 f t t 2 f 790 "700 790" 100 0 0 100 flt4_mul_cash - )); DATA(insert OID = 848 ( flt4_mul_cash PGUID 11 f t t 2 f 790 "700 790" 100 0 0 100 flt4_mul_cash - ));
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 849 ( textpos PGUID 11 f t t 2 f 23 "25 25" 100 0 1 0 textpos - )); DATA(insert OID = 849 ( position PGUID 11 f t t 2 f 23 "25 25" 100 0 1 0 textpos - ));
DESCR("return position of substring"); DESCR("return position of substring");
DATA(insert OID = 850 ( textlike PGUID 11 f t t 2 f 16 "25 25" 100 0 1 0 textlike - )); DATA(insert OID = 850 ( textlike PGUID 11 f t t 2 f 16 "25 25" 100 0 1 0 textlike - ));
DESCR("matches LIKE expression"); DESCR("matches LIKE expression");
...@@ -1115,9 +1115,9 @@ DESCR("matches LIKE expression"); ...@@ -1115,9 +1115,9 @@ DESCR("matches LIKE expression");
DATA(insert OID = 859 ( namenlike PGUID 11 f t t 2 f 16 "19 25" 100 0 0 100 namenlike - )); DATA(insert OID = 859 ( namenlike PGUID 11 f t t 2 f 16 "19 25" 100 0 0 100 namenlike - ));
DESCR("does not match LIKE expression"); DESCR("does not match LIKE expression");
DATA(insert OID = 860 ( char_bpchar PGUID 11 f t t 1 f 1042 "18" 100 0 0 100 char_bpchar - )); DATA(insert OID = 860 ( bpchar PGUID 11 f t t 1 f 1042 "18" 100 0 0 100 char_bpchar - ));
DESCR("convert char to char()"); DESCR("convert char to char()");
DATA(insert OID = 861 ( bpchar_char PGUID 11 f t t 1 f 18 "1042" 100 0 0 100 bpchar_char - )); DATA(insert OID = 861 ( char PGUID 11 f t t 1 f 18 "1042" 100 0 0 100 bpchar_char - ));
DESCR("convert char() to char"); DESCR("convert char() to char");
DATA(insert OID = 862 ( int4_mul_cash PGUID 11 f t t 2 f 790 "23 790" 100 0 0 100 int4_mul_cash - )); DATA(insert OID = 862 ( int4_mul_cash PGUID 11 f t t 2 f 790 "23 790" 100 0 0 100 int4_mul_cash - ));
...@@ -1179,18 +1179,26 @@ DESCR(""); ...@@ -1179,18 +1179,26 @@ DESCR("");
DATA(insert OID = 939 ( revertpoly PGUID 11 f t f 1 f 604 "604" 100 0 0 100 revertpoly - )); DATA(insert OID = 939 ( revertpoly PGUID 11 f t f 1 f 604 "604" 100 0 0 100 revertpoly - ));
DESCR(""); DESCR("");
DATA(insert OID = 942 ( char_text PGUID 11 f t t 1 f 25 "18" 100 0 0 100 char_text - )); DATA(insert OID = 940 ( mod PGUID 11 f t t 2 f 21 "21 21" 100 0 0 100 int2mod - ));
DESCR("convert char to text"); DESCR("modulus");
DATA(insert OID = 943 ( text_char PGUID 11 f t t 1 f 18 "25" 100 0 0 100 text_char - )); DATA(insert OID = 941 ( mod PGUID 11 f t t 2 f 23 "23 23" 100 0 0 100 int4mod - ));
DESCR("convert text to char"); DESCR("modulus");
DATA(insert OID = 942 ( mod PGUID 11 f t t 2 f 23 "21 23" 100 0 0 100 int24mod - ));
DESCR("modulus");
DATA(insert OID = 943 ( mod PGUID 11 f t t 2 f 23 "23 21" 100 0 0 100 int42mod - ));
DESCR("modulus");
DATA(insert OID = 945 ( int8mod PGUID 11 f t t 2 f 20 "20 20" 100 0 0 100 int8mod - ));
DESCR("modulus");
DATA(insert OID = 947 ( mod PGUID 11 f t t 2 f 20 "20 20" 100 0 0 100 int8mod - ));
DESCR("modulus");
DATA(insert OID = 944 ( char PGUID 11 f t t 1 f 18 "25" 100 0 0 100 text_char - )); DATA(insert OID = 944 ( char PGUID 11 f t t 1 f 18 "25" 100 0 0 100 text_char - ));
DESCR("convert text to char()"); DESCR("convert text to char");
DATA(insert OID = 946 ( text PGUID 11 f t t 1 f 25 "18" 100 0 0 100 char_text - )); DATA(insert OID = 946 ( text PGUID 11 f t t 1 f 25 "18" 100 0 0 100 char_text - ));
DESCR("convert char to text"); DESCR("convert char to text");
DATA(insert OID = 947 ( char PGUID 11 f t t 1 f 18 "1042" 100 0 0 100 bpchar_char - ));
DESCR("convert char() to char");
DATA(insert OID = 948 ( varchar PGUID 11 f t t 1 f 25 "1043" 100 0 0 100 bpchar_char - )); DATA(insert OID = 948 ( varchar PGUID 11 f t t 1 f 25 "1043" 100 0 0 100 bpchar_char - ));
DESCR("convert char to text"); DESCR("convert varchar() to text");
DATA(insert OID = 950 ( istrue PGUID 11 f t t 1 f 16 "16" 100 0 0 100 istrue - )); DATA(insert OID = 950 ( istrue PGUID 11 f t t 1 f 16 "16" 100 0 0 100 istrue - ));
DESCR(""); DESCR("");
...@@ -1213,9 +1221,9 @@ DATA(insert OID = 958 ( lo_tell PGUID 11 f t f 1 f 23 "23" 100 0 0 100 lo_ ...@@ -1213,9 +1221,9 @@ DATA(insert OID = 958 ( lo_tell PGUID 11 f t f 1 f 23 "23" 100 0 0 100 lo_
DESCR("large object position"); DESCR("large object position");
DATA(insert OID = 959 ( on_pl PGUID 11 f t t 2 f 16 "600 628" 100 0 10 100 on_pl - )); DATA(insert OID = 959 ( on_pl PGUID 11 f t t 2 f 16 "600 628" 100 0 10 100 on_pl - ));
DESCR("contained in"); DESCR("point on line?");
DATA(insert OID = 960 ( on_sl PGUID 11 f t t 2 f 16 "601 628" 100 0 10 100 on_sl - )); DATA(insert OID = 960 ( on_sl PGUID 11 f t t 2 f 16 "601 628" 100 0 10 100 on_sl - ));
DESCR("contained in"); DESCR("lseg on line?");
DATA(insert OID = 961 ( close_pl PGUID 11 f t t 2 f 600 "600 628" 100 0 10 100 close_pl - )); DATA(insert OID = 961 ( close_pl PGUID 11 f t t 2 f 600 "600 628" 100 0 10 100 close_pl - ));
DESCR("closest point on line"); DESCR("closest point on line");
DATA(insert OID = 962 ( close_sl PGUID 11 f t t 2 f 600 "601 628" 100 0 10 100 close_sl - )); DATA(insert OID = 962 ( close_sl PGUID 11 f t t 2 f 600 "601 628" 100 0 10 100 close_sl - ));
...@@ -1229,18 +1237,18 @@ DATA(insert OID = 972 ( regproctooid PGUID 11 f t t 1 f 26 "24" 100 0 0 100 ...@@ -1229,18 +1237,18 @@ DATA(insert OID = 972 ( regproctooid PGUID 11 f t t 1 f 26 "24" 100 0 0 100
DESCR("get oid for regproc"); DESCR("get oid for regproc");
DATA(insert OID = 973 ( path_inter PGUID 11 f t t 2 f 16 "602 602" 100 0 10 100 path_inter - )); DATA(insert OID = 973 ( path_inter PGUID 11 f t t 2 f 16 "602 602" 100 0 10 100 path_inter - ));
DESCR(""); DESCR("paths intersect?");
DATA(insert OID = 975 ( box_area PGUID 11 f t t 1 f 701 "603" 100 0 0 100 box_area - )); DATA(insert OID = 975 ( area PGUID 11 f t t 1 f 701 "603" 100 0 0 100 box_area - ));
DESCR("box area"); DESCR("box area");
DATA(insert OID = 976 ( box_width PGUID 11 f t t 1 f 701 "603" 100 0 0 100 box_width - )); DATA(insert OID = 976 ( width PGUID 11 f t t 1 f 701 "603" 100 0 0 100 box_width - ));
DESCR("box width"); DESCR("box width");
DATA(insert OID = 977 ( box_height PGUID 11 f t t 1 f 701 "603" 100 0 0 100 box_height - )); DATA(insert OID = 977 ( height PGUID 11 f t t 1 f 701 "603" 100 0 0 100 box_height - ));
DESCR("box height"); DESCR("box height");
DATA(insert OID = 978 ( box_distance PGUID 11 f t t 2 f 701 "603 603" 100 0 0 100 box_distance - )); DATA(insert OID = 978 ( box_distance PGUID 11 f t t 2 f 701 "603 603" 100 0 0 100 box_distance - ));
DESCR("distance between"); DESCR("distance between boxes");
DATA(insert OID = 980 ( box_intersect PGUID 11 f t t 2 f 603 "603 603" 100 0 0 100 box_intersect - )); DATA(insert OID = 980 ( box_intersect PGUID 11 f t t 2 f 603 "603 603" 100 0 0 100 box_intersect - ));
DESCR("intersects"); DESCR("box intersection (another box)");
DATA(insert OID = 981 ( box_diagonal PGUID 11 f t t 1 f 601 "603" 100 0 0 100 box_diagonal - )); DATA(insert OID = 981 ( diagonal PGUID 11 f t t 1 f 601 "603" 100 0 0 100 box_diagonal - ));
DESCR("box diagonal"); DESCR("box diagonal");
DATA(insert OID = 982 ( path_n_lt PGUID 11 f t t 2 f 16 "602 602" 100 0 0 100 path_n_lt - )); DATA(insert OID = 982 ( path_n_lt PGUID 11 f t t 2 f 16 "602 602" 100 0 0 100 path_n_lt - ));
DESCR("less-than"); DESCR("less-than");
...@@ -1257,25 +1265,25 @@ DESCR("sum of path segments"); ...@@ -1257,25 +1265,25 @@ DESCR("sum of path segments");
DATA(insert OID = 988 ( point_ne PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_ne - )); DATA(insert OID = 988 ( point_ne PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_ne - ));
DESCR("not equal"); DESCR("not equal");
DATA(insert OID = 989 ( point_vert PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_vert - )); DATA(insert OID = 989 ( point_vert PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_vert - ));
DESCR("is vertical"); DESCR("vertical?");
DATA(insert OID = 990 ( point_horiz PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_horiz - )); DATA(insert OID = 990 ( point_horiz PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_horiz - ));
DESCR("is horizontal"); DESCR("horizontal?");
DATA(insert OID = 991 ( point_distance PGUID 11 f t t 2 f 701 "600 600" 100 0 0 100 point_distance - )); DATA(insert OID = 991 ( point_distance PGUID 11 f t t 2 f 701 "600 600" 100 0 0 100 point_distance - ));
DESCR("distance between"); DESCR("distance between");
DATA(insert OID = 992 ( point_slope PGUID 11 f t t 2 f 701 "600 600" 100 0 0 100 point_slope - )); DATA(insert OID = 992 ( slope PGUID 11 f t t 2 f 701 "600 600" 100 0 0 100 point_slope - ));
DESCR("slope between points"); DESCR("slope between points");
DATA(insert OID = 993 ( lseg_construct PGUID 11 f t t 2 f 601 "600 600" 100 0 0 100 lseg_construct - )); DATA(insert OID = 993 ( lseg PGUID 11 f t t 2 f 601 "600 600" 100 0 0 100 lseg_construct - ));
DESCR("convert points to line segment"); DESCR("convert points to line segment");
DATA(insert OID = 994 ( lseg_intersect PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_intersect - )); DATA(insert OID = 994 ( lseg_intersect PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_intersect - ));
DESCR("intersects"); DESCR("intersects?");
DATA(insert OID = 995 ( lseg_parallel PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_parallel - )); DATA(insert OID = 995 ( lseg_parallel PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_parallel - ));
DESCR("is parallel to"); DESCR("parallel?");
DATA(insert OID = 996 ( lseg_perp PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_perp - )); DATA(insert OID = 996 ( lseg_perp PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_perp - ));
DESCR("is perpendicular to"); DESCR("perpendicular?");
DATA(insert OID = 997 ( lseg_vertical PGUID 11 f t t 1 f 16 "601" 100 0 0 100 lseg_vertical - )); DATA(insert OID = 997 ( lseg_vertical PGUID 11 f t t 1 f 16 "601" 100 0 0 100 lseg_vertical - ));
DESCR("is vertical"); DESCR("vertical?");
DATA(insert OID = 998 ( lseg_horizontal PGUID 11 f t t 1 f 16 "601" 100 0 0 100 lseg_horizontal - )); DATA(insert OID = 998 ( lseg_horizontal PGUID 11 f t t 1 f 16 "601" 100 0 0 100 lseg_horizontal - ));
DESCR("is horizontal"); DESCR("horizontal?");
DATA(insert OID = 999 ( lseg_eq PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_eq - )); DATA(insert OID = 999 ( lseg_eq PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_eq - ));
DESCR("equal"); DESCR("equal");
...@@ -1413,10 +1421,8 @@ DATA(insert OID = 1156 ( timestamp_ge PGUID 11 f t f 2 f 16 "1184 1184" 100 ...@@ -1413,10 +1421,8 @@ DATA(insert OID = 1156 ( timestamp_ge PGUID 11 f t f 2 f 16 "1184 1184" 100
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 1157 ( timestamp_gt PGUID 11 f t f 2 f 16 "1184 1184" 100 0 0 100 timestamp_gt - )); DATA(insert OID = 1157 ( timestamp_gt PGUID 11 f t f 2 f 16 "1184 1184" 100 0 0 100 timestamp_gt - ));
DESCR("greater-than"); DESCR("greater-than");
DATA(insert OID = 1158 ( timestamp_finite PGUID 11 f t f 1 f 16 "1184" 100 0 0 100 timestamp_finite - )); DATA(insert OID = 1159 ( timezone PGUID 11 f t f 2 f 25 "25 1184" 100 0 0 100 timestamp_zone - ));
DESCR(""); DESCR("time zone");
DATA(insert OID = 1159 ( timestamp_zone PGUID 11 f t f 2 f 25 "25 1184" 100 0 0 100 timestamp_zone - ));
DESCR("");
DATA(insert OID = 1160 ( interval_in PGUID 11 f t f 1 f 1186 "0" 100 0 0 100 interval_in - )); DATA(insert OID = 1160 ( interval_in PGUID 11 f t f 1 f 1186 "0" 100 0 0 100 interval_in - ));
DESCR("(internal)"); DESCR("(internal)");
...@@ -1440,24 +1446,24 @@ DATA(insert OID = 1169 ( interval_pl PGUID 11 f t f 2 f 1186 "1186 1186" 100 ...@@ -1440,24 +1446,24 @@ DATA(insert OID = 1169 ( interval_pl PGUID 11 f t f 2 f 1186 "1186 1186" 100
DESCR("addition"); DESCR("addition");
DATA(insert OID = 1170 ( interval_mi PGUID 11 f t f 2 f 1186 "1186 1186" 100 0 0 100 interval_mi - )); DATA(insert OID = 1170 ( interval_mi PGUID 11 f t f 2 f 1186 "1186 1186" 100 0 0 100 interval_mi - ));
DESCR("subtract"); DESCR("subtract");
DATA(insert OID = 1171 ( timestamp_part PGUID 11 f t f 2 f 701 "25 1184" 100 0 0 100 timestamp_part - )); DATA(insert OID = 1171 ( date_part PGUID 11 f t f 2 f 701 "25 1184" 100 0 0 100 timestamp_part - ));
DESCR("extract field from timestamp"); DESCR("extract field from timestamp");
DATA(insert OID = 1172 ( interval_part PGUID 11 f t f 2 f 701 "25 1186" 100 0 0 100 interval_part - )); DATA(insert OID = 1172 ( date_part PGUID 11 f t f 2 f 701 "25 1186" 100 0 0 100 interval_part - ));
DESCR("extract field from interval"); DESCR("extract field from interval");
DATA(insert OID = 1173 ( abstime_timestamp PGUID 11 f t f 1 f 1184 "702" 100 0 0 100 abstime_timestamp - )); DATA(insert OID = 1173 ( timestamp PGUID 11 f t f 1 f 1184 "702" 100 0 0 100 abstime_timestamp - ));
DESCR("convert abstime to timestamp"); DESCR("convert abstime to timestamp");
DATA(insert OID = 1174 ( date_timestamp PGUID 11 f t f 1 f 1184 "1082" 100 0 0 100 date_timestamp - )); DATA(insert OID = 1174 ( timestamp PGUID 11 f t f 1 f 1184 "1082" 100 0 0 100 date_timestamp - ));
DESCR("convert date to timestamp"); DESCR("convert date to timestamp");
DATA(insert OID = 1176 ( datetime_timestamp PGUID 11 f t f 2 f 1184 "1082 1083" 100 0 0 100 datetime_timestamp - )); DATA(insert OID = 1176 ( timestamp PGUID 11 f t f 2 f 1184 "1082 1083" 100 0 0 100 datetime_timestamp - ));
DESCR("convert date and time to timestamp"); DESCR("convert date and time to timestamp");
DATA(insert OID = 1177 ( reltime_interval PGUID 11 f t f 1 f 1186 "703" 100 0 0 100 reltime_interval - )); DATA(insert OID = 1177 ( interval PGUID 11 f t f 1 f 1186 "703" 100 0 0 100 reltime_interval - ));
DESCR("convert reltime to interval"); DESCR("convert reltime to interval");
DATA(insert OID = 1178 ( timestamp_date PGUID 11 f t f 1 f 1082 "1184" 100 0 0 100 timestamp_date - )); DATA(insert OID = 1178 ( date PGUID 11 f t f 1 f 1082 "1184" 100 0 0 100 timestamp_date - ));
DESCR("convert timestamp to date"); DESCR("convert timestamp to date");
DATA(insert OID = 1179 ( abstime_date PGUID 11 f t f 1 f 1082 "702" 100 0 0 100 abstime_date - )); DATA(insert OID = 1179 ( date PGUID 11 f t f 1 f 1082 "702" 100 0 0 100 abstime_date - ));
DESCR("convert abstime to date"); DESCR("convert abstime to date");
DATA(insert OID = 1180 ( timestamp_abstime PGUID 11 f t f 1 f 702 "1184" 100 0 0 100 timestamp_abstime - )); DATA(insert OID = 1180 ( abstime PGUID 11 f t f 1 f 702 "1184" 100 0 0 100 timestamp_abstime - ));
DESCR("convert timestamp to abstime"); DESCR("convert timestamp to abstime");
DATA(insert OID = 1188 ( timestamp_mi PGUID 11 f t f 2 f 1186 "1184 1184" 100 0 0 100 timestamp_mi - )); DATA(insert OID = 1188 ( timestamp_mi PGUID 11 f t f 2 f 1186 "1184 1184" 100 0 0 100 timestamp_mi - ));
...@@ -1466,13 +1472,13 @@ DATA(insert OID = 1189 ( timestamp_pl_span PGUID 11 f t f 2 f 1184 "1184 1186" ...@@ -1466,13 +1472,13 @@ DATA(insert OID = 1189 ( timestamp_pl_span PGUID 11 f t f 2 f 1184 "1184 1186"
DESCR("plus"); DESCR("plus");
DATA(insert OID = 1190 ( timestamp_mi_span PGUID 11 f t f 2 f 1184 "1184 1186" 100 0 0 100 timestamp_mi_span - )); DATA(insert OID = 1190 ( timestamp_mi_span PGUID 11 f t f 2 f 1184 "1184 1186" 100 0 0 100 timestamp_mi_span - ));
DESCR("minus"); DESCR("minus");
DATA(insert OID = 1191 ( text_timestamp PGUID 11 f t f 1 f 1184 "25" 100 0 0 100 text_timestamp - )); DATA(insert OID = 1191 ( timestamp PGUID 11 f t f 1 f 1184 "25" 100 0 0 100 text_timestamp - ));
DESCR("convert text to timestamp"); DESCR("convert text to timestamp");
DATA(insert OID = 1192 ( timestamp_text PGUID 11 f t f 1 f 25 "1184" 100 0 0 100 timestamp_text - )); DATA(insert OID = 1192 ( text PGUID 11 f t f 1 f 25 "1184" 100 0 0 100 timestamp_text - ));
DESCR("convert timestamp to text"); DESCR("convert timestamp to text");
DATA(insert OID = 1193 ( interval_text PGUID 11 f t f 1 f 25 "1186" 100 0 0 100 interval_text - )); DATA(insert OID = 1193 ( text PGUID 11 f t f 1 f 25 "1186" 100 0 0 100 interval_text - ));
DESCR("convert interval to text"); DESCR("convert interval to text");
DATA(insert OID = 1194 ( interval_reltime PGUID 11 f t f 1 f 703 "1186" 100 0 0 100 interval_reltime - )); DATA(insert OID = 1194 ( reltime PGUID 11 f t f 1 f 703 "1186" 100 0 0 100 interval_reltime - ));
DESCR("convert interval to reltime"); DESCR("convert interval to reltime");
DATA(insert OID = 1195 ( timestamp_smaller PGUID 11 f t f 2 f 1184 "1184 1184" 100 0 0 100 timestamp_smaller - )); DATA(insert OID = 1195 ( timestamp_smaller PGUID 11 f t f 2 f 1184 "1184 1184" 100 0 0 100 timestamp_smaller - ));
DESCR("smaller of two"); DESCR("smaller of two");
...@@ -1482,21 +1488,21 @@ DATA(insert OID = 1197 ( interval_smaller PGUID 11 f t f 2 f 1186 "1186 1186" ...@@ -1482,21 +1488,21 @@ DATA(insert OID = 1197 ( interval_smaller PGUID 11 f t f 2 f 1186 "1186 1186"
DESCR("smaller of two"); DESCR("smaller of two");
DATA(insert OID = 1198 ( interval_larger PGUID 11 f t f 2 f 1186 "1186 1186" 100 0 0 100 interval_larger - )); DATA(insert OID = 1198 ( interval_larger PGUID 11 f t f 2 f 1186 "1186 1186" 100 0 0 100 interval_larger - ));
DESCR("larger of two"); DESCR("larger of two");
DATA(insert OID = 1199 ( timestamp_age PGUID 11 f t f 2 f 1186 "1184 1184" 100 0 0 100 timestamp_age - )); DATA(insert OID = 1199 ( age PGUID 11 f t f 2 f 1186 "1184 1184" 100 0 0 100 timestamp_age - ));
DESCR("date difference preserving months and years"); DESCR("date difference preserving months and years");
/* OIDS 1200 - 1299 */ /* OIDS 1200 - 1299 */
DATA(insert OID = 1200 ( int4reltime PGUID 11 f t t 1 f 703 "23" 100 0 0 100 int4reltime - )); DATA(insert OID = 1200 ( reltime PGUID 11 f t t 1 f 703 "23" 100 0 0 100 int4reltime - ));
DESCR("convert int4 to reltime"); DESCR("convert int4 to reltime");
DATA(insert OID = 1217 ( timestamp_trunc PGUID 11 f t f 2 f 1184 "25 1184" 100 0 0 100 timestamp_trunc - )); DATA(insert OID = 1217 ( date_trunc PGUID 11 f t f 2 f 1184 "25 1184" 100 0 0 100 timestamp_trunc - ));
DESCR("truncate timestamp to specified units"); DESCR("truncate timestamp to specified units");
DATA(insert OID = 1218 ( interval_trunc PGUID 11 f t f 2 f 1186 "25 1186" 100 0 0 100 interval_trunc - )); DATA(insert OID = 1218 ( date_trunc PGUID 11 f t f 2 f 1186 "25 1186" 100 0 0 100 interval_trunc - ));
DESCR("truncate interval to specified units"); DESCR("truncate interval to specified units");
DATA(insert OID = 1230 ( bpchar PGUID 11 f t t 1 f 1042 "18" 100 0 0 100 char_bpchar - )); DATA(insert OID = 1230 ( int8abs PGUID 11 f t t 1 f 20 "20" 100 0 0 100 int8abs - ));
DESCR("convert char to char()"); DESCR("absolute value");
DATA(insert OID = 1236 ( int8larger PGUID 11 f t t 2 f 20 "20 20" 100 0 0 100 int8larger - )); DATA(insert OID = 1236 ( int8larger PGUID 11 f t t 2 f 20 "20 20" 100 0 0 100 int8larger - ));
DESCR("larger of two"); DESCR("larger of two");
...@@ -1512,19 +1518,18 @@ DESCR("matches regex., case-insensitive"); ...@@ -1512,19 +1518,18 @@ DESCR("matches regex., case-insensitive");
DATA(insert OID = 1241 ( nameicregexne PGUID 11 f t t 2 f 16 "19 25" 100 0 0 100 nameicregexne - )); DATA(insert OID = 1241 ( nameicregexne PGUID 11 f t t 2 f 16 "19 25" 100 0 0 100 nameicregexne - ));
DESCR("does not match regex., case-insensitive"); DESCR("does not match regex., case-insensitive");
DATA(insert OID = 1251 ( bpcharlen PGUID 11 f t t 1 f 23 "1042" 100 0 0 100 bpcharlen - )); DATA(insert OID = 1251 ( int4abs PGUID 11 f t t 1 f 23 "23" 100 0 0 100 int4abs - ));
DESCR("octet length"); DESCR("absolute value");
DATA(insert OID = 1378 ( bpcharoctetlen PGUID 11 f t t 1 f 23 "1042" 100 0 0 100 bpcharoctetlen - )); DATA(insert OID = 1253 ( int2abs PGUID 11 f t t 1 f 21 "21" 100 0 0 100 int2abs - ));
DESCR("octet length"); DESCR("absolute value");
DATA(insert OID = 1253 ( varcharlen PGUID 11 f t t 1 f 23 "1043" 100 0 0 100 varcharlen - ));
DESCR("character length");
DATA(insert OID = 1379 ( varcharoctetlen PGUID 11 f t t 1 f 23 "1043" 100 0 0 100 varcharoctetlen - ));
DESCR("octet length");
DATA(insert OID = 1263 ( text_interval PGUID 11 f t f 1 f 1186 "25" 100 0 0 100 text_interval - )); DATA(insert OID = 1263 ( interval PGUID 11 f t f 1 f 1186 "25" 100 0 0 100 text_interval - ));
DESCR("convert text to interval"); DESCR("convert text to interval");
DATA(insert OID = 1271 ( interval_finite PGUID 11 f t f 1 f 16 "1186" 100 0 0 100 interval_finite - ));
DESCR("boolean test"); DATA(insert OID = 1271 ( overlaps PGUID 11 f t t 4 f 16 "1266 1266 1266 1266" 100 0 1 0 overlaps_timetz - ));
DESCR("SQL92 interval comparison");
DATA(insert OID = 1272 ( datetime_pl PGUID 11 f t f 2 f 1184 "1082 1083" 100 0 0 100 datetime_timestamp - ));
DESCR("convert date and time to timestamp");
DATA(insert OID = 1274 ( int84pl PGUID 11 f t t 2 f 20 "20 23" 100 0 0 100 int84pl - )); DATA(insert OID = 1274 ( int84pl PGUID 11 f t t 2 f 20 "20 23" 100 0 0 100 int84pl - ));
DESCR("addition"); DESCR("addition");
...@@ -1543,9 +1548,9 @@ DESCR("multiply"); ...@@ -1543,9 +1548,9 @@ DESCR("multiply");
DATA(insert OID = 1281 ( int48div PGUID 11 f t t 2 f 20 "23 20" 100 0 0 100 int48div - )); DATA(insert OID = 1281 ( int48div PGUID 11 f t t 2 f 20 "23 20" 100 0 0 100 int48div - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 1288 ( int8_text PGUID 11 f t t 1 f 25 "20" 100 0 0 100 int8_text - )); DATA(insert OID = 1288 ( text PGUID 11 f t t 1 f 25 "20" 100 0 0 100 int8_text - ));
DESCR("convert int8 to text"); DESCR("convert int8 to text");
DATA(insert OID = 1289 ( text_int8 PGUID 11 f t t 1 f 20 "25" 100 0 0 100 text_int8 - )); DATA(insert OID = 1289 ( int8 PGUID 11 f t t 1 f 20 "25" 100 0 0 100 text_int8 - ));
DESCR("convert text to int8"); DESCR("convert text to int8");
DATA(insert OID = 1290 ( _bpchar PGUID 11 f t t 2 f 1014 "1014 23" 100 0 0 100 _bpchar - )); DATA(insert OID = 1290 ( _bpchar PGUID 11 f t t 2 f 1014 "1014 23" 100 0 0 100 _bpchar - ));
...@@ -1560,6 +1565,12 @@ DESCR("latest tid of a tuple"); ...@@ -1560,6 +1565,12 @@ DESCR("latest tid of a tuple");
DATA(insert OID = 1294 ( currtid2 PGUID 11 f t f 2 f 27 "25 27" 100 0 0 100 currtid_byrelname - )); DATA(insert OID = 1294 ( currtid2 PGUID 11 f t f 2 f 27 "25 27" 100 0 0 100 currtid_byrelname - ));
DESCR("latest tid of a tuple"); DESCR("latest tid of a tuple");
DATA(insert OID = 1296 ( timedate_pl PGUID 14 f t f 2 f 1184 "1083 1082" 100 0 0 100 "select datetime_pl($2, $1)" - ));
DESCR("convert time and date to timestamp");
DATA(insert OID = 1297 ( datetimetz_pl PGUID 11 f t f 2 f 1184 "1082 1266" 100 0 0 100 datetimetz_timestamp - ));
DESCR("convert date and time with time zone to timestamp");
DATA(insert OID = 1298 ( timetzdate_pl PGUID 14 f t f 2 f 1184 "1266 1082" 100 0 0 100 "select datetimetz_pl($2, $1)" - ));
DESCR("convert time with time zone and date to timestamp");
DATA(insert OID = 1299 ( now PGUID 11 f t f 0 f 1184 "0" 100 0 0 100 now - )); DATA(insert OID = 1299 ( now PGUID 11 f t f 0 f 1184 "0" 100 0 0 100 now - ));
DESCR("current transaction time"); DESCR("current transaction time");
...@@ -1574,79 +1585,106 @@ DESCR("restriction selectivity for containment comparison operators"); ...@@ -1574,79 +1585,106 @@ DESCR("restriction selectivity for containment comparison operators");
DATA(insert OID = 1303 ( contjoinsel PGUID 11 f t f 5 f 701 "26 26 21 26 21" 100 0 0 100 contjoinsel - )); DATA(insert OID = 1303 ( contjoinsel PGUID 11 f t f 5 f 701 "26 26 21 26 21" 100 0 0 100 contjoinsel - ));
DESCR("join selectivity for containment comparison operators"); DESCR("join selectivity for containment comparison operators");
DATA(insert OID = 1304 ( overlaps PGUID 11 f t t 4 f 16 "1184 1184 1184 1184" 100 0 1 0 overlaps_timestamp - ));
DESCR("SQL92 interval comparison");
DATA(insert OID = 1305 ( overlaps PGUID 14 f t t 4 f 16 "1184 1186 1184 1186" 100 0 1 0 "select overlaps($1, ($1 + $2), $3, ($3 + $4))" - ));
DESCR("SQL92 interval comparison");
DATA(insert OID = 1306 ( overlaps PGUID 14 f t t 4 f 16 "1184 1184 1184 1186" 100 0 1 0 "select overlaps($1, $2, $3, ($3 + $4))" - ));
DESCR("SQL92 interval comparison");
DATA(insert OID = 1307 ( overlaps PGUID 14 f t t 4 f 16 "1184 1186 1184 1184" 100 0 1 0 "select overlaps($1, ($1 + $2), $3, $4)" - ));
DESCR("SQL92 interval comparison");
DATA(insert OID = 1308 ( overlaps PGUID 11 f t t 4 f 16 "1083 1083 1083 1083" 100 0 1 0 overlaps_time - ));
DESCR("SQL92 interval comparison");
DATA(insert OID = 1309 ( overlaps PGUID 14 f t t 4 f 16 "1083 1186 1083 1186" 100 0 1 0 "select overlaps($1, ($1 + $2), $3, ($3 + $4))" - ));
DESCR("SQL92 interval comparison");
DATA(insert OID = 1310 ( overlaps PGUID 14 f t t 4 f 16 "1083 1083 1083 1186" 100 0 1 0 "select overlaps($1, $2, $3, ($3 + $4))" - ));
DESCR("SQL92 interval comparison");
DATA(insert OID = 1311 ( overlaps PGUID 14 f t t 4 f 16 "1083 1186 1083 1083" 100 0 1 0 "select overlaps($1, ($1 + $2), $3, $4)" - ));
DESCR("SQL92 interval comparison");
DATA(insert OID = 1314 ( timestamp_cmp PGUID 11 f t f 2 f 23 "1184 1184" 100 0 0 100 timestamp_cmp - )); DATA(insert OID = 1314 ( timestamp_cmp PGUID 11 f t f 2 f 23 "1184 1184" 100 0 0 100 timestamp_cmp - ));
DESCR("less-equal-greater"); DESCR("less-equal-greater");
DATA(insert OID = 1315 ( interval_cmp PGUID 11 f t f 2 f 23 "1186 1186" 100 0 0 100 interval_cmp - )); DATA(insert OID = 1315 ( interval_cmp PGUID 11 f t f 2 f 23 "1186 1186" 100 0 0 100 interval_cmp - ));
DESCR("less-equal-greater"); DESCR("less-equal-greater");
DATA(insert OID = 1316 ( timestamp_time PGUID 11 f t f 1 f 1083 "1184" 100 0 0 100 timestamp_time - )); DATA(insert OID = 1316 ( time PGUID 11 f t f 1 f 1083 "1184" 100 0 0 100 timestamp_time - ));
DESCR("convert timestamp to time"); DESCR("convert timestamp to time");
DATA(insert OID = 1317 ( length PGUID 11 f t t 1 f 23 "25" 100 0 1 0 textlen - ));
DESCR("length");
DATA(insert OID = 1318 ( length PGUID 11 f t t 1 f 23 "1042" 100 0 0 100 bpcharlen - ));
DESCR("character length");
DATA(insert OID = 1319 ( length PGUID 11 f t t 1 f 23 "1043" 100 0 0 100 varcharlen - ));
DESCR("character length");
DATA(insert OID = 1326 ( interval_div PGUID 11 f t f 2 f 1186 "1186 701" 100 0 0 100 interval_div - )); DATA(insert OID = 1326 ( interval_div PGUID 11 f t f 2 f 1186 "1186 701" 100 0 0 100 interval_div - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 1339 ( date_zone PGUID 11 f t f 2 f 25 "25 1184" 100 0 0 100 timestamp_zone - )); DATA(insert OID = 1339 ( dlog10 PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dlog10 - ));
DESCR(""); DESCR("base 10 logarithm");
DATA(insert OID = 1340 ( text PGUID 11 f t f 1 f 25 "1184" 100 0 0 100 timestamp_text - )); DATA(insert OID = 1340 ( log PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dlog10 - ));
DESCR("convert timestamp to text"); DESCR("base 10 logarithm");
DATA(insert OID = 1341 ( text PGUID 11 f t f 1 f 25 "1186" 100 0 0 100 interval_text - )); DATA(insert OID = 1341 ( ln PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dlog1 - ));
DESCR("convert interval to text"); DESCR("base 10 logarithm");
DATA(insert OID = 1342 ( text PGUID 11 f t t 1 f 25 "23" 100 0 0 100 int4_text - )); DATA(insert OID = 1342 ( round PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dround - ));
DESCR("convert int4 to text"); DESCR("round to integral part");
DATA(insert OID = 1343 ( text PGUID 11 f t t 1 f 25 "21" 100 0 0 100 int2_text - )); DATA(insert OID = 1343 ( trunc PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dtrunc - ));
DESCR("convert int2 to text"); DESCR("truncate to integral part");
DATA(insert OID = 1344 ( text PGUID 11 f t t 1 f 25 "26" 100 0 0 100 oid_text - )); DATA(insert OID = 1344 ( sqrt PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dsqrt - ));
DESCR("convert oid to text"); DESCR("square root");
DATA(insert OID = 1345 ( oid PGUID 11 f t t 1 f 26 "25" 100 0 0 100 text_oid - )); DATA(insert OID = 1345 ( cbrt PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dcbrt - ));
DESCR("convert text to oid"); DESCR("cube root");
DATA(insert OID = 1346 ( int2 PGUID 11 f t t 1 f 21 "25" 100 0 0 100 text_int2 - )); DATA(insert OID = 1346 ( pow PGUID 11 f t t 2 f 701 "701 701" 100 0 0 100 dpow - ));
DESCR("convert text to int2"); DESCR("exponentiation");
DATA(insert OID = 1347 ( int4 PGUID 11 f t t 1 f 23 "25" 100 0 0 100 text_int4 - )); DATA(insert OID = 1347 ( exp PGUID 11 f t t 1 f 701 "701" 100 0 0 100 dexp - ));
DESCR("convert text to int4"); DESCR("exponential");
DATA(insert OID = 1348 ( obj_description PGUID 14 f t f 1 f 25 "26" 100 0 0 100 "select description from pg_description where objoid = $1" - )); DATA(insert OID = 1348 ( obj_description PGUID 14 f t f 1 f 25 "26" 100 0 0 100 "select description from pg_description where objoid = $1" - ));
DESCR("get description for object id"); DESCR("get description for object id");
DATA(insert OID = 1349 ( oidvectortypes PGUID 11 f t f 1 f 25 "30" 100 0 0 100 oidvectortypes - )); DATA(insert OID = 1349 ( oidvectortypes PGUID 11 f t f 1 f 25 "30" 100 0 0 100 oidvectortypes - ));
DESCR("print type names of oidvector field"); DESCR("print type names of oidvector field");
DATA(insert OID = 1350 ( timestamp PGUID 14 f t f 1 f 1184 "1184" 100 0 0 100 "select $1" - ));
DESCR("convert (noop)"); DATA(insert OID = 1350 ( timetz_in PGUID 11 f t f 1 f 1266 "0" 100 0 0 100 timetz_in - ));
DATA(insert OID = 1351 ( timestamp PGUID 11 f t f 1 f 1184 "25" 100 0 0 100 text_timestamp - )); DESCR("(internal)");
DESCR("convert text to timestamp"); DATA(insert OID = 1351 ( timetz_out PGUID 11 f t f 1 f 23 "0" 100 0 0 100 timetz_out - ));
DATA(insert OID = 1352 ( timestamp PGUID 11 f t f 1 f 1184 "702" 100 0 0 100 abstime_timestamp - )); DESCR("(internal)");
DESCR("convert abstime to timestamp"); DATA(insert OID = 1352 ( timetz_eq PGUID 11 f t t 2 f 16 "1266 1266" 100 0 0 100 timetz_eq - ));
DATA(insert OID = 1353 ( timestamp PGUID 11 f t f 1 f 1184 "1082" 100 0 0 100 date_timestamp - )); DESCR("equal");
DESCR("convert date to timestamp"); DATA(insert OID = 1353 ( timetz_ne PGUID 11 f t t 2 f 16 "1266 1266" 100 0 0 100 timetz_ne - ));
DATA(insert OID = 1355 ( timestamp PGUID 11 f t f 2 f 1184 "1082 1083" 100 0 0 100 datetime_timestamp - )); DESCR("not equal");
DESCR("convert date and time to timestamp"); DATA(insert OID = 1354 ( timetz_lt PGUID 11 f t t 2 f 16 "1266 1266" 100 0 0 100 timetz_lt - ));
DATA(insert OID = 1356 ( interval PGUID 14 f t t 1 f 1186 "1186" 100 0 0 100 "select $1" - )); DESCR("less-than");
DESCR("convert (noop)"); DATA(insert OID = 1355 ( timetz_le PGUID 11 f t t 2 f 16 "1266 1266" 100 0 0 100 timetz_le - ));
DATA(insert OID = 1357 ( interval PGUID 11 f t f 1 f 1186 "703" 100 0 0 100 reltime_interval - )); DESCR("less-than-or-equal");
DESCR("convert reltime to interval"); DATA(insert OID = 1356 ( timetz_ge PGUID 11 f t t 2 f 16 "1266 1266" 100 0 0 100 timetz_ge - ));
DATA(insert OID = 1358 ( interval PGUID 14 f t f 1 f 1186 "1083" 100 0 0 100 "select time_interval($1)" - )); DESCR("greater-than-or-equal");
DESCR("convert time to interval"); DATA(insert OID = 1357 ( timetz_gt PGUID 11 f t t 2 f 16 "1266 1266" 100 0 0 100 timetz_gt - ));
DATA(insert OID = 1359 ( date PGUID 14 f t t 1 f 1082 "1082" 100 0 0 100 "select $1" - )); DESCR("greater-than");
DESCR("convert (noop)"); DATA(insert OID = 1358 ( timetz_cmp PGUID 11 f t t 2 f 23 "1266 1266" 100 0 0 100 timetz_cmp - ));
DATA(insert OID = 1360 ( date PGUID 11 f t f 1 f 1082 "1184" 100 0 0 100 timestamp_date - )); DESCR("less-equal-greater");
DESCR("convert timestamp to date"); DATA(insert OID = 1359 ( timestamp PGUID 11 f t f 2 f 1184 "1082 1266" 100 0 0 100 datetimetz_timestamp - ));
DATA(insert OID = 1361 ( date PGUID 11 f t f 1 f 1082 "702" 100 0 0 100 abstime_date - )); DESCR("convert date and time with time zone to timestamp");
DESCR("convert abstime to date");
DATA(insert OID = 1362 ( time PGUID 14 f t t 1 f 1083 "1083" 100 0 0 100 "select $1" - )); DATA(insert OID = 1362 ( time PGUID 14 f t t 1 f 1083 "1083" 100 0 0 100 "select $1" - ));
DESCR("convert (noop)"); DESCR("convert (noop)");
DATA(insert OID = 1363 ( time PGUID 11 f t f 1 f 1083 "1184" 100 0 0 100 timestamp_time - ));
DESCR("convert timestamp to time");
DATA(insert OID = 1364 ( time PGUID 14 f t f 1 f 1083 "702" 100 0 0 100 "select time(timestamp($1))" - )); DATA(insert OID = 1364 ( time PGUID 14 f t f 1 f 1083 "702" 100 0 0 100 "select time(timestamp($1))" - ));
DESCR("convert abstime to time"); DESCR("convert abstime to time");
DATA(insert OID = 1365 ( abstime PGUID 14 f t f 1 f 702 "702" 100 0 0 100 "select $1" - )); DATA(insert OID = 1365 ( abstime PGUID 14 f t f 1 f 702 "702" 100 0 0 100 "select $1" - ));
DESCR("convert (noop)"); DESCR("convert (noop)");
DATA(insert OID = 1366 ( abstime PGUID 11 f t f 1 f 702 "1184" 100 0 0 100 timestamp_abstime - ));
DESCR("convert timestamp to abstime");
DATA(insert OID = 1367 ( reltime PGUID 14 f t t 1 f 703 "703" 100 0 0 100 "select $1" - )); DATA(insert OID = 1367 ( reltime PGUID 14 f t t 1 f 703 "703" 100 0 0 100 "select $1" - ));
DESCR("convert (noop)"); DESCR("convert (noop)");
DATA(insert OID = 1368 ( reltime PGUID 11 f t f 1 f 703 "1186" 100 0 0 100 interval_reltime - )); DATA(insert OID = 1368 ( timestamp PGUID 14 f t f 1 f 1184 "1184" 100 0 0 100 "select $1" - ));
DESCR("convert interval to reltime"); DESCR("convert (noop)");
DATA(insert OID = 1371 ( length PGUID 11 f t t 1 f 23 "25" 100 0 0 100 textlen - )); DATA(insert OID = 1369 ( interval PGUID 14 f t t 1 f 1186 "1186" 100 0 0 100 "select $1" - ));
DESCR("character length"); DESCR("convert (noop)");
DATA(insert OID = 1372 ( length PGUID 11 f t t 1 f 23 "1042" 100 0 0 100 bpcharlen - )); DATA(insert OID = 1370 ( interval PGUID 11 f t f 1 f 1186 "1083" 100 0 0 100 time_interval - ));
DESCR("convert time to interval");
DATA(insert OID = 1371 ( date PGUID 14 f t t 1 f 1082 "1082" 100 0 0 100 "select $1" - ));
DESCR("convert (noop)");
DATA(insert OID = 1372 ( char_length PGUID 11 f t t 1 f 23 "1042" 100 0 0 100 bpcharlen - ));
DESCR("character length"); DESCR("character length");
DATA(insert OID = 1373 ( length PGUID 11 f t t 1 f 23 "1043" 100 0 0 100 varcharlen - )); DATA(insert OID = 1373 ( char_length PGUID 11 f t t 1 f 23 "1043" 100 0 0 100 varcharlen - ));
DESCR("character length"); DESCR("character length");
DATA(insert OID = 1374 ( octet_length PGUID 11 f t t 1 f 23 "25" 100 0 0 100 textoctetlen - )); DATA(insert OID = 1374 ( octet_length PGUID 11 f t t 1 f 23 "25" 100 0 0 100 textoctetlen - ));
...@@ -1656,90 +1694,95 @@ DESCR("octet length"); ...@@ -1656,90 +1694,95 @@ DESCR("octet length");
DATA(insert OID = 1376 ( octet_length PGUID 11 f t t 1 f 23 "1043" 100 0 0 100 varcharoctetlen - )); DATA(insert OID = 1376 ( octet_length PGUID 11 f t t 1 f 23 "1043" 100 0 0 100 varcharoctetlen - ));
DESCR("octet length"); DESCR("octet length");
DATA(insert OID = 1380 ( date_part PGUID 11 f t f 2 f 701 "25 1184" 100 0 0 100 timestamp_part - )); DATA(insert OID = 1377 ( time_larger PGUID 11 f t t 2 f 1083 "1083 1083" 100 0 0 100 time_larger - ));
DESCR("extract field from timestamp"); DESCR("larger of two");
DATA(insert OID = 1381 ( date_part PGUID 11 f t f 2 f 701 "25 1186" 100 0 0 100 interval_part - )); DATA(insert OID = 1378 ( time_smaller PGUID 11 f t t 2 f 1083 "1083 1083" 100 0 0 100 time_smaller - ));
DESCR("extract field from interval"); DESCR("smaller of two");
DATA(insert OID = 1382 ( date_part PGUID 14 f t f 2 f 701 "25 702" 100 0 0 100 "select timestamp_part($1, timestamp($2))" - )); DATA(insert OID = 1379 ( timetz_larger PGUID 11 f t t 2 f 1083 "1266 1266" 100 0 0 100 timetz_larger - ));
DESCR("larger of two");
DATA(insert OID = 1380 ( timetz_smaller PGUID 11 f t t 2 f 1083 "1266 1266" 100 0 0 100 timetz_smaller - ));
DESCR("smaller of two");
DATA(insert OID = 1381 ( char_length PGUID 11 f t t 1 f 23 "25" 100 0 1 0 textlen - ));
DESCR("length");
DATA(insert OID = 1382 ( date_part PGUID 14 f t f 2 f 701 "25 702" 100 0 0 100 "select date_part($1, timestamp($2))" - ));
DESCR("extract field from abstime"); DESCR("extract field from abstime");
DATA(insert OID = 1383 ( date_part PGUID 14 f t f 2 f 701 "25 703" 100 0 0 100 "select interval_part($1, interval($2))" - )); DATA(insert OID = 1383 ( date_part PGUID 14 f t f 2 f 701 "25 703" 100 0 0 100 "select date_part($1, interval($2))" - ));
DESCR("extract field from reltime"); DESCR("extract field from reltime");
DATA(insert OID = 1384 ( date_part PGUID 14 f t f 2 f 701 "25 1082" 100 0 0 100 "select timestamp_part($1, timestamp($2))" - )); DATA(insert OID = 1384 ( date_part PGUID 14 f t f 2 f 701 "25 1082" 100 0 0 100 "select date_part($1, timestamp($2))" - ));
DESCR("extract field from date"); DESCR("extract field from date");
DATA(insert OID = 1385 ( date_part PGUID 14 f t f 2 f 701 "25 1083" 100 0 0 100 "select interval_part($1, interval($2))" - )); DATA(insert OID = 1385 ( date_part PGUID 14 f t f 2 f 701 "25 1083" 100 0 0 100 "select date_part($1, interval($2))" - ));
DESCR("extract field from time"); DESCR("extract field from time");
DATA(insert OID = 1386 ( date_trunc PGUID 11 f t f 2 f 1184 "25 1184" 100 0 0 100 timestamp_trunc - )); DATA(insert OID = 1386 ( age PGUID 14 f t f 1 f 1186 "1184" 100 0 0 100 "select age(\'today\', $1)" - ));
DESCR("truncate timestamp to field"); DESCR("date difference from today preserving months and years");
DATA(insert OID = 1387 ( date_trunc PGUID 11 f t f 2 f 1186 "25 1186" 100 0 0 100 interval_trunc - ));
DESCR("truncate interval to field"); DATA(insert OID = 1387 ( timetz PGUID 14 f t f 1 f 1266 "1266" 100 0 0 100 "select $1" - ));
DATA(insert OID = 1388 ( age PGUID 11 f t f 2 f 1186 "1184 1184" 100 0 0 100 timestamp_age - )); DESCR("noop conversion");
DESCR("difference between timestamps but leave years and months unresolved"); DATA(insert OID = 1388 ( timetz PGUID 11 f t f 1 f 1266 "1184" 100 0 0 100 timestamp_timetz - ));
DATA(insert OID = 1389 ( age PGUID 14 f t f 1 f 1186 "1184" 100 0 0 100 "select timestamp_age(\'today\', $1)" - )); DESCR("convert timestamp to time");
DESCR("difference between timestamp and today but leave years and months unresolved");
DATA(insert OID = 1389 ( isfinite PGUID 11 f t f 1 f 16 "1184" 100 0 0 100 timestamp_finite - ));
DATA(insert OID = 1390 ( isfinite PGUID 11 f t f 1 f 16 "1184" 100 0 0 100 timestamp_finite - ));
DESCR("boolean test");
DATA(insert OID = 1391 ( isfinite PGUID 11 f t f 1 f 16 "1186" 100 0 0 100 interval_finite - ));
DESCR("boolean test"); DESCR("boolean test");
DATA(insert OID = 1392 ( isfinite PGUID 11 f t f 1 f 16 "702" 100 0 0 100 abstime_finite - )); DATA(insert OID = 1390 ( isfinite PGUID 11 f t f 1 f 16 "1186" 100 0 0 100 interval_finite - ));
DESCR("boolean test"); DESCR("boolean test");
DATA(insert OID = 1393 ( interval PGUID 11 f t f 1 f 1186 "25" 100 0 0 100 text_interval - ));
DESCR("convert text to interval");
DATA(insert OID = 1394 ( name PGUID 11 f t t 1 f 19 "25" 100 0 0 100 text_name - )); DATA(insert OID = 1391 ( factorial PGUID 11 f t t 1 f 23 "21" 100 0 0 100 int2fac - ));
DESCR("convert text to name"); DESCR("factorial");
DATA(insert OID = 1395 ( text PGUID 11 f t t 1 f 25 "19" 100 0 0 100 name_text - )); DATA(insert OID = 1392 ( factorial PGUID 11 f t t 1 f 23 "23" 100 0 0 100 int4fac - ));
DESCR("convert name to text"); DESCR("factorial");
DATA(insert OID = 1396 ( name PGUID 11 f t t 1 f 19 "1042" 100 0 0 100 bpchar_name - )); DATA(insert OID = 1393 ( factorial PGUID 11 f t t 1 f 20 "20" 100 0 0 100 int8fac - ));
DESCR("convert char() to name"); DESCR("factorial");
DATA(insert OID = 1397 ( bpchar PGUID 11 f t t 1 f 1042 "19" 100 0 0 100 name_bpchar - )); DATA(insert OID = 1394 ( abs PGUID 11 f t t 1 f 700 "700" 100 0 0 100 float4abs - ));
DESCR("convert name to char()"); DESCR("absolute value");
DATA(insert OID = 1398 ( name PGUID 11 f t t 1 f 19 "1043" 100 0 0 100 text_name - )); DATA(insert OID = 1395 ( abs PGUID 11 f t t 1 f 701 "701" 100 0 0 100 float8abs - ));
DESCR("convert varchar to name"); DESCR("absolute value");
DATA(insert OID = 1399 ( varchar PGUID 11 f t t 1 f 1043 "19" 100 0 0 100 name_text - )); DATA(insert OID = 1396 ( abs PGUID 11 f t t 1 f 20 "20" 100 0 0 100 int8abs - ));
DESCR("convert convert name to varchar"); DESCR("absolute value");
DATA(insert OID = 1397 ( abs PGUID 11 f t t 1 f 23 "23" 100 0 0 100 int4abs - ));
DESCR("absolute value");
DATA(insert OID = 1398 ( abs PGUID 11 f t t 1 f 21 "21" 100 0 0 100 int2abs - ));
DESCR("absolute value");
/* OIDS 1400 - 1499 */ /* OIDS 1400 - 1499 */
DATA(insert OID = 1400 ( float PGUID 14 f t t 1 f 701 "701" 100 0 0 100 "select $1" - )); DATA(insert OID = 1400 ( name PGUID 11 f t t 1 f 19 "1043" 100 0 0 100 text_name - ));
DESCR("convert float8 to float8 (no-op)"); DESCR("convert varchar to name");
DATA(insert OID = 1401 ( float PGUID 11 f t t 1 f 701 "700" 100 0 0 100 ftod - )); DATA(insert OID = 1401 ( varchar PGUID 11 f t t 1 f 1043 "19" 100 0 0 100 name_text - ));
DESCR("convert float4 to float8"); DESCR("convert convert name to varchar");
DATA(insert OID = 1402 ( float4 PGUID 14 f t t 1 f 700 "700" 100 0 0 100 "select $1" - )); DATA(insert OID = 1402 ( float4 PGUID 14 f t t 1 f 700 "700" 100 0 0 100 "select $1" - ));
DESCR("convert float4 to float4 (no-op)"); DESCR("convert float4 to float4 (no-op)");
DATA(insert OID = 1403 ( float4 PGUID 11 f t t 1 f 700 "701" 100 0 0 100 dtof - )); DATA(insert OID = 1403 ( int2 PGUID 14 f t t 1 f 21 "21" 100 0 0 100 "select $1" - ));
DESCR("convert float8 to float4");
DATA(insert OID = 1404 ( int PGUID 14 f t t 1 f 23 "23" 100 0 0 100 "select $1" - ));
DESCR("convert (no-op)");
DATA(insert OID = 1405 ( int2 PGUID 14 f t t 1 f 21 "21" 100 0 0 100 "select $1" - ));
DESCR("convert (no-op)"); DESCR("convert (no-op)");
DATA(insert OID = 1406 ( float8 PGUID 14 f t t 1 f 701 "701" 100 0 0 100 "select $1" - )); DATA(insert OID = 1404 ( float8 PGUID 14 f t t 1 f 701 "701" 100 0 0 100 "select $1" - ));
DESCR("convert (no-op)"); DESCR("convert (no-op)");
DATA(insert OID = 1407 ( float8 PGUID 11 f t t 1 f 701 "700" 100 0 0 100 ftod - )); DATA(insert OID = 1405 ( int4 PGUID 14 f t t 1 f 23 "23" 100 0 0 100 "select $1" - ));
DESCR("convert float4 to float8");
DATA(insert OID = 1408 ( float8 PGUID 11 f t t 1 f 701 "23" 100 0 0 100 i4tod - ));
DESCR("convert int4 to float8");
DATA(insert OID = 1409 ( float8 PGUID 11 f t t 1 f 701 "21" 100 0 0 100 i2tod - ));
DESCR("convert int2 to float8");
DATA(insert OID = 1410 ( float4 PGUID 11 f t t 1 f 700 "23" 100 0 0 100 i4tof - ));
DESCR("convert int4 to float4");
DATA(insert OID = 1411 ( float4 PGUID 11 f t t 1 f 700 "21" 100 0 0 100 i2tof - ));
DESCR("convert int2 to float4");
DATA(insert OID = 1412 ( int4 PGUID 14 f t t 1 f 23 "23" 100 0 0 100 "select $1" - ));
DESCR("convert (no-op)"); DESCR("convert (no-op)");
DATA(insert OID = 1413 ( int4 PGUID 11 f t t 1 f 23 "701" 100 0 0 100 dtoi4 - ));
DESCR("convert float8 to int4"); DATA(insert OID = 1406 ( isvertical PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_vert - ));
DATA(insert OID = 1414 ( int4 PGUID 11 f t t 1 f 23 "21" 100 0 0 100 i2toi4 - )); DESCR("vertical?");
DESCR("convert int2 to int4"); DATA(insert OID = 1407 ( ishorizontal PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_horiz - ));
DATA(insert OID = 1415 ( int4 PGUID 11 f t t 1 f 23 "700" 100 0 0 100 ftoi4 - )); DESCR("horizontal?");
DESCR("convert float4 to int4"); DATA(insert OID = 1408 ( isparallel PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_parallel - ));
DATA(insert OID = 1417 ( int2 PGUID 11 f t t 1 f 21 "23" 100 0 0 100 i4toi2 - )); DESCR("parallel?");
DESCR("convert int4 to int2"); DATA(insert OID = 1409 ( isperp PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_perp - ));
DATA(insert OID = 1418 ( int2 PGUID 11 f t t 1 f 21 "701" 100 0 0 100 dtoi2 - )); DESCR("perpendicular?");
DESCR("convert float8 to int2"); DATA(insert OID = 1410 ( isvertical PGUID 11 f t t 1 f 16 "601" 100 0 0 100 lseg_vertical - ));
DATA(insert OID = 1419 ( int2 PGUID 11 f t t 1 f 21 "700" 100 0 0 100 ftoi2 - )); DESCR("vertical?");
DESCR("convert float4 to int2"); DATA(insert OID = 1411 ( ishorizontal PGUID 11 f t t 1 f 16 "601" 100 0 0 100 lseg_horizontal - ));
DESCR("horizontal?");
DATA(insert OID = 1412 ( isparallel PGUID 11 f t t 2 f 16 "628 628" 100 0 0 100 line_parallel - ));
DESCR("lines parallel?");
DATA(insert OID = 1413 ( isperp PGUID 11 f t t 2 f 16 "628 628" 100 0 0 100 line_perp - ));
DESCR("lines perpendicular?");
DATA(insert OID = 1414 ( isvertical PGUID 11 f t t 1 f 16 "628" 100 0 0 100 line_vertical - ));
DESCR("lines vertical?");
DATA(insert OID = 1415 ( ishorizontal PGUID 11 f t t 1 f 16 "628" 100 0 0 100 line_horizontal - ));
DESCR("lines horizontal?");
DATA(insert OID = 1416 ( point PGUID 11 f t t 1 f 600 "718" 100 0 1 0 circle_center - ));
DESCR("center of");
DATA(insert OID = 1421 ( box PGUID 11 f t t 2 f 603 "600 600" 100 0 0 100 box - )); DATA(insert OID = 1421 ( box PGUID 11 f t t 2 f 603 "600 600" 100 0 0 100 box - ));
DESCR("convert points to box"); DESCR("convert points to box");
...@@ -1751,25 +1794,28 @@ DATA(insert OID = 1424 ( box_mul PGUID 11 f t t 2 f 603 "603 600" 100 0 0 100 ...@@ -1751,25 +1794,28 @@ DATA(insert OID = 1424 ( box_mul PGUID 11 f t t 2 f 603 "603 600" 100 0 0 100
DESCR("multiply box by point (scale)"); DESCR("multiply box by point (scale)");
DATA(insert OID = 1425 ( box_div PGUID 11 f t t 2 f 603 "603 600" 100 0 0 100 box_div - )); DATA(insert OID = 1425 ( box_div PGUID 11 f t t 2 f 603 "603 600" 100 0 0 100 box_div - ));
DESCR("divide box by point (scale)"); DESCR("divide box by point (scale)");
DATA(insert OID = 1426 ( path_contain_pt PGUID 11 f t t 2 f 16 "602 600" 100 0 0 100 path_contain_pt - )); DATA(insert OID = 1426 ( path_contain_pt PGUID 14 f t t 2 f 16 "602 600" 100 0 0 100 "select on_ppath($2, $1)" - ));
DESCR("path contains point?"); DESCR("path contains point?");
DATA(insert OID = 1427 ( pt_contained_path PGUID 11 f t t 2 f 16 "600 602" 100 0 0 100 pt_contained_path - ));
DESCR("point contained in path?");
DATA(insert OID = 1428 ( poly_contain_pt PGUID 11 f t t 2 f 16 "604 600" 100 0 0 100 poly_contain_pt - )); DATA(insert OID = 1428 ( poly_contain_pt PGUID 11 f t t 2 f 16 "604 600" 100 0 0 100 poly_contain_pt - ));
DESCR("polygon contains point?"); DESCR("polygon contains point?");
DATA(insert OID = 1429 ( pt_contained_poly PGUID 11 f t t 2 f 16 "600 604" 100 0 0 100 pt_contained_poly - )); DATA(insert OID = 1429 ( pt_contained_poly PGUID 11 f t t 2 f 16 "600 604" 100 0 0 100 pt_contained_poly - ));
DESCR("point contained by polygon?"); DESCR("point contained by polygon?");
DATA(insert OID = 1430 ( path_isclosed PGUID 11 f t t 1 f 16 "602" 100 0 0 100 path_isclosed - )); DATA(insert OID = 1430 ( isclosed PGUID 11 f t t 1 f 16 "602" 100 0 0 100 path_isclosed - ));
DESCR(""); DESCR("path closed?");
DATA(insert OID = 1431 ( path_isopen PGUID 11 f t t 1 f 16 "602" 100 0 0 100 path_isopen - )); DATA(insert OID = 1431 ( isopen PGUID 11 f t t 1 f 16 "602" 100 0 0 100 path_isopen - ));
DESCR(""); DESCR("path open?");
DATA(insert OID = 1432 ( path_npoints PGUID 11 f t t 1 f 23 "602" 100 0 0 100 path_npoints - )); DATA(insert OID = 1432 ( path_npoints PGUID 11 f t t 1 f 23 "602" 100 0 0 100 path_npoints - ));
DESCR(""); DESCR("# points in path");
DATA(insert OID = 1433 ( path_close PGUID 11 f t t 1 f 602 "602" 100 0 0 100 path_close - ));
DESCR(""); /* pclose and popen might better be named close and open, but that crashes initdb.
DATA(insert OID = 1434 ( path_open PGUID 11 f t t 1 f 602 "602" 100 0 0 100 path_open - )); * - thomas 97/04/20
DESCR(""); */
DATA(insert OID = 1433 ( pclose PGUID 11 f t t 1 f 602 "602" 100 0 0 100 path_close - ));
DESCR("close path");
DATA(insert OID = 1434 ( popen PGUID 11 f t t 1 f 602 "602" 100 0 0 100 path_open - ));
DESCR("open path");
DATA(insert OID = 1435 ( path_add PGUID 11 f t t 2 f 602 "602 602" 100 0 0 100 path_add - )); DATA(insert OID = 1435 ( path_add PGUID 11 f t t 2 f 602 "602 602" 100 0 0 100 path_add - ));
DESCR("addition"); DESCR("addition");
DATA(insert OID = 1436 ( path_add_pt PGUID 11 f t t 2 f 602 "602 600" 100 0 0 100 path_add_pt - )); DATA(insert OID = 1436 ( path_add_pt PGUID 11 f t t 2 f 602 "602 600" 100 0 0 100 path_add_pt - ));
...@@ -1794,13 +1840,13 @@ DESCR("divide points (scale/rotate)"); ...@@ -1794,13 +1840,13 @@ DESCR("divide points (scale/rotate)");
DATA(insert OID = 1445 ( poly_npoints PGUID 11 f t t 1 f 23 "604" 100 0 0 100 poly_npoints - )); DATA(insert OID = 1445 ( poly_npoints PGUID 11 f t t 1 f 23 "604" 100 0 0 100 poly_npoints - ));
DESCR("number of points in polygon"); DESCR("number of points in polygon");
DATA(insert OID = 1446 ( poly_box PGUID 11 f t t 1 f 603 "604" 100 0 0 100 poly_box - )); DATA(insert OID = 1446 ( box PGUID 11 f t t 1 f 603 "604" 100 0 0 100 poly_box - ));
DESCR("convert polygon to bounding box"); DESCR("convert polygon to bounding box");
DATA(insert OID = 1447 ( poly_path PGUID 11 f t t 1 f 602 "604" 100 0 0 100 poly_path - )); DATA(insert OID = 1447 ( path PGUID 11 f t t 1 f 602 "604" 100 0 0 100 poly_path - ));
DESCR("convert polygon to path"); DESCR("convert polygon to path");
DATA(insert OID = 1448 ( box_poly PGUID 11 f t t 1 f 604 "603" 100 0 0 100 box_poly - )); DATA(insert OID = 1448 ( polygon PGUID 11 f t t 1 f 604 "603" 100 0 0 100 box_poly - ));
DESCR("convert box to polygon"); DESCR("convert box to polygon");
DATA(insert OID = 1449 ( path_poly PGUID 11 f t t 1 f 604 "602" 100 0 0 100 path_poly - )); DATA(insert OID = 1449 ( polygon PGUID 11 f t t 1 f 604 "602" 100 0 0 100 path_poly - ));
DESCR("convert path to polygon"); DESCR("convert path to polygon");
DATA(insert OID = 1450 ( circle_in PGUID 11 f t t 1 f 718 "0" 100 0 1 0 circle_in - )); DATA(insert OID = 1450 ( circle_in PGUID 11 f t t 1 f 718 "0" 100 0 1 0 circle_in - ));
...@@ -1839,35 +1885,34 @@ DATA(insert OID = 1466 ( circle_le PGUID 11 f t t 2 f 16 "718 718" 100 0 1 0 ...@@ -1839,35 +1885,34 @@ DATA(insert OID = 1466 ( circle_le PGUID 11 f t t 2 f 16 "718 718" 100 0 1 0
DESCR("less-than-or-equal"); DESCR("less-than-or-equal");
DATA(insert OID = 1467 ( circle_ge PGUID 11 f t t 2 f 16 "718 718" 100 0 1 0 circle_ge - )); DATA(insert OID = 1467 ( circle_ge PGUID 11 f t t 2 f 16 "718 718" 100 0 1 0 circle_ge - ));
DESCR("greater-than-or-equal"); DESCR("greater-than-or-equal");
DATA(insert OID = 1468 ( circle_area PGUID 11 f t t 1 f 701 "718" 100 0 1 0 circle_area - )); DATA(insert OID = 1468 ( area PGUID 11 f t t 1 f 701 "718" 100 0 1 0 circle_area - ));
DESCR("area"); DESCR("area of circle");
DATA(insert OID = 1469 ( circle_diameter PGUID 11 f t t 1 f 701 "718" 100 0 1 0 circle_diameter - )); DATA(insert OID = 1469 ( diameter PGUID 11 f t t 1 f 701 "718" 100 0 1 0 circle_diameter - ));
DESCR("diameter"); DESCR("diameter of circle");
DATA(insert OID = 1470 ( circle_radius PGUID 11 f t t 1 f 701 "718" 100 0 1 0 circle_radius - )); DATA(insert OID = 1470 ( radius PGUID 11 f t t 1 f 701 "718" 100 0 1 0 circle_radius - ));
DESCR("radius"); DESCR("radius of circle");
DATA(insert OID = 1471 ( circle_distance PGUID 11 f t t 2 f 701 "718 718" 100 0 1 0 circle_distance - )); DATA(insert OID = 1471 ( circle_distance PGUID 11 f t t 2 f 701 "718 718" 100 0 1 0 circle_distance - ));
DESCR("distance between"); DESCR("distance between");
DATA(insert OID = 1472 ( circle_center PGUID 11 f t t 1 f 600 "718" 100 0 1 0 circle_center - )); DATA(insert OID = 1472 ( circle_center PGUID 11 f t t 1 f 600 "718" 100 0 1 0 circle_center - ));
DESCR("center of"); DESCR("center of");
DATA(insert OID = 1473 ( circle PGUID 11 f t t 2 f 718 "600 701" 100 0 1 0 circle - )); DATA(insert OID = 1473 ( circle PGUID 11 f t t 2 f 718 "600 701" 100 0 1 0 circle - ));
DESCR("convert point and radius to circle"); DESCR("convert point and radius to circle");
DATA(insert OID = 1474 ( poly_circle PGUID 11 f t t 1 f 718 "604" 100 0 1 0 poly_circle - )); DATA(insert OID = 1474 ( circle PGUID 11 f t t 1 f 718 "604" 100 0 1 0 poly_circle - ));
DESCR("convert polygon to circle"); DESCR("convert polygon to circle");
DATA(insert OID = 1475 ( circle_poly PGUID 11 f t t 2 f 604 "23 718" 100 0 1 0 circle_poly - )); DATA(insert OID = 1475 ( polygon PGUID 11 f t t 2 f 604 "23 718" 100 0 1 0 circle_poly - ));
DESCR("convert vertex count and circle to polygon"); DESCR("convert vertex count and circle to polygon");
DATA(insert OID = 1476 ( dist_pc PGUID 11 f t t 2 f 701 "600 718" 100 0 1 0 dist_pc - )); DATA(insert OID = 1476 ( dist_pc PGUID 11 f t t 2 f 701 "600 718" 100 0 1 0 dist_pc - ));
DESCR("distance between"); DESCR("distance between point and circle");
DATA(insert OID = 1477 ( circle_contain_pt PGUID 11 f t t 2 f 16 "718 600" 100 0 0 100 circle_contain_pt - )); DATA(insert OID = 1477 ( circle_contain_pt PGUID 11 f t t 2 f 16 "718 600" 100 0 0 100 circle_contain_pt - ));
DESCR(""); DESCR("circle contains point?");
DATA(insert OID = 1478 ( pt_contained_circle PGUID 11 f t t 2 f 16 "600 718" 100 0 0 100 pt_contained_circle - )); DATA(insert OID = 1478 ( pt_contained_circle PGUID 11 f t t 2 f 16 "600 718" 100 0 0 100 pt_contained_circle - ));
DESCR(""); DESCR("point inside circle?");
DATA(insert OID = 1479 ( box_circle PGUID 11 f t t 1 f 718 "603" 100 0 1 0 box_circle - )); DATA(insert OID = 1479 ( circle PGUID 11 f t t 1 f 718 "603" 100 0 1 0 box_circle - ));
DESCR("convert box to circle"); DESCR("convert box to circle");
DATA(insert OID = 1480 ( circle_box PGUID 11 f t t 1 f 603 "718" 100 0 1 0 circle_box - )); DATA(insert OID = 1480 ( box PGUID 11 f t t 1 f 603 "718" 100 0 1 0 circle_box - ));
DESCR("convert circle to box"); DESCR("convert circle to box");
DATA(insert OID = 1481 ( tinterval PGUID 11 f t f 2 f 704 "702 702" 100 0 0 100 mktinterval - ));
DATA(insert OID = 1481 ( text_substr PGUID 11 f t t 3 f 25 "25 23 23" 100 0 0 100 text_substr - )); DESCR("convert to tinterval");
DESCR("return portion of string");
DATA(insert OID = 1482 ( lseg_ne PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_ne - )); DATA(insert OID = 1482 ( lseg_ne PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_ne - ));
DESCR("not equal"); DESCR("not equal");
...@@ -1892,7 +1937,7 @@ DATA(insert OID = 1491 ( line_out PGUID 11 f t t 1 f 23 "0" 100 0 0 100 line ...@@ -1892,7 +1937,7 @@ DATA(insert OID = 1491 ( line_out PGUID 11 f t t 1 f 23 "0" 100 0 0 100 line
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1492 ( line_eq PGUID 11 f t t 2 f 16 "628 628" 100 0 0 100 line_eq - )); DATA(insert OID = 1492 ( line_eq PGUID 11 f t t 2 f 16 "628 628" 100 0 0 100 line_eq - ));
DESCR("lines equal?"); DESCR("lines equal?");
DATA(insert OID = 1493 ( line_construct_pp PGUID 11 f t t 2 f 628 "600 600" 100 0 0 100 line_construct_pp - )); DATA(insert OID = 1493 ( line PGUID 11 f t t 2 f 628 "600 600" 100 0 0 100 line_construct_pp - ));
DESCR("line from points"); DESCR("line from points");
DATA(insert OID = 1494 ( line_interpt PGUID 11 f t t 2 f 600 "628 628" 100 0 0 100 line_interpt - )); DATA(insert OID = 1494 ( line_interpt PGUID 11 f t t 2 f 600 "628 628" 100 0 0 100 line_interpt - ));
DESCR("intersection point"); DESCR("intersection point");
...@@ -1909,135 +1954,90 @@ DESCR("lines horizontal?"); ...@@ -1909,135 +1954,90 @@ DESCR("lines horizontal?");
/* OIDS 1500 - 1599 */ /* OIDS 1500 - 1599 */
DATA(insert OID = 1530 ( point PGUID 11 f t t 2 f 600 "601 601" 100 0 0 100 lseg_interpt - )); DATA(insert OID = 1530 ( length PGUID 11 f t t 1 f 701 "601" 100 0 1 0 lseg_length - ));
DESCR("convert two line segments to point (intersection)"); DESCR("distance between endpoints");
DATA(insert OID = 1531 ( point PGUID 11 f t t 1 f 600 "718" 100 0 0 100 circle_center - )); DATA(insert OID = 1531 ( length PGUID 11 f t t 1 f 701 "602" 100 0 1 0 path_length - ));
DESCR("convert circle to point (center)"); DESCR("sum of path segments");
DATA(insert OID = 1532 ( isvertical PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_vert - ));
DESCR("");
DATA(insert OID = 1533 ( ishorizontal PGUID 11 f t t 2 f 16 "600 600" 100 0 0 100 point_horiz - ));
DESCR("");
DATA(insert OID = 1534 ( slope PGUID 11 f t t 2 f 701 "600 600" 100 0 0 100 point_slope - ));
DESCR("");
DATA(insert OID = 1540 ( lseg PGUID 11 f t t 2 f 601 "600 600" 100 0 0 100 lseg_construct - ));
DESCR("");
DATA(insert OID = 1541 ( lseg PGUID 11 f t t 1 f 601 "603" 100 0 0 100 box_diagonal - ));
DESCR("");
DATA(insert OID = 1542 ( isparallel PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_parallel - ));
DESCR("");
DATA(insert OID = 1543 ( isperpendicular PGUID 11 f t t 2 f 16 "601 601" 100 0 0 100 lseg_perp - ));
DESCR("");
DATA(insert OID = 1544 ( isvertical PGUID 11 f t t 1 f 16 "601" 100 0 0 100 lseg_vertical - ));
DESCR("");
DATA(insert OID = 1545 ( ishorizontal PGUID 11 f t t 1 f 16 "601" 100 0 0 100 lseg_horizontal - ));
DESCR("");
/* pclose and popen might better be named close and open, but that crashes initdb.
* - tgl 97/04/20
*/
DATA(insert OID = 1550 ( path PGUID 11 f t t 1 f 602 "604" 100 0 0 100 poly_path - )); DATA(insert OID = 1532 ( point PGUID 11 f t t 1 f 600 "601" 100 0 0 100 lseg_center - ));
DESCR(""); DESCR("center of");
DATA(insert OID = 1551 ( length PGUID 11 f t t 1 f 701 "602" 100 0 1 0 path_length - )); DATA(insert OID = 1533 ( point PGUID 11 f t t 1 f 600 "602" 100 0 0 100 path_center - ));
DESCR("sum of lengths of path segments"); DESCR("center of");
DATA(insert OID = 1552 ( points PGUID 11 f t t 1 f 23 "602" 100 0 0 100 path_npoints - )); DATA(insert OID = 1534 ( point PGUID 11 f t t 1 f 600 "603" 100 1 0 100 box_center - ));
DESCR(""); DESCR("center of");
DATA(insert OID = 1553 ( pclose PGUID 11 f t t 1 f 602 "602" 100 0 0 100 path_close - )); DATA(insert OID = 1540 ( point PGUID 11 f t t 1 f 600 "604" 100 0 0 100 poly_center - ));
DESCR(""); DESCR("center of");
DATA(insert OID = 1554 ( popen PGUID 11 f t t 1 f 602 "602" 100 0 0 100 path_open - )); DATA(insert OID = 1541 ( lseg PGUID 11 f t t 1 f 601 "603" 100 0 0 100 box_diagonal - ));
DESCR("");
DATA(insert OID = 1555 ( isopen PGUID 11 f t t 1 f 16 "602" 100 0 0 100 path_isopen - ));
DESCR("");
DATA(insert OID = 1556 ( isclosed PGUID 11 f t t 1 f 16 "602" 100 0 0 100 path_isclosed - ));
DESCR(""); DESCR("");
DATA(insert OID = 1542 ( center PGUID 11 f t t 1 f 600 "603" 100 1 0 100 box_center - ));
DATA(insert OID = 1560 ( box PGUID 11 f t t 2 f 603 "603 603" 100 0 0 100 box_intersect - )); DESCR("center of");
DESCR("convert boxes to box (intersection)"); DATA(insert OID = 1543 ( center PGUID 11 f t t 1 f 600 "718" 100 0 1 0 circle_center - ));
DATA(insert OID = 1561 ( box PGUID 11 f t t 1 f 603 "604" 100 0 0 100 poly_box - )); DESCR("center of");
DESCR("convert polygon to box"); DATA(insert OID = 1544 ( polygon PGUID 14 f t t 1 f 604 "718" 100 0 0 100 "select polygon(12, $1)" - ));
DATA(insert OID = 1562 ( width PGUID 11 f t t 1 f 701 "603" 100 0 0 100 box_width - ));
DESCR("box width");
DATA(insert OID = 1563 ( height PGUID 11 f t t 1 f 701 "603" 100 0 0 100 box_height - ));
DESCR("box height");
DATA(insert OID = 1564 ( center PGUID 11 f t t 1 f 600 "603" 100 0 0 100 box_center - ));
DESCR("box center");
DATA(insert OID = 1565 ( area PGUID 11 f t t 1 f 701 "603" 100 0 0 100 box_area - ));
DESCR("box area");
DATA(insert OID = 1569 ( box PGUID 11 f t t 1 f 603 "718" 100 0 0 100 circle_box - ));
DESCR("convert circle to box");
DATA(insert OID = 1570 ( polygon PGUID 11 f t t 1 f 604 "602" 100 0 0 100 path_poly - ));
DESCR("convert path to polygon");
DATA(insert OID = 1571 ( polygon PGUID 11 f t t 1 f 604 "603" 100 0 0 100 box_poly - ));
DESCR("convert box to polygon");
DATA(insert OID = 1572 ( polygon PGUID 11 f t t 2 f 604 "23 718" 100 0 0 100 circle_poly - ));
DESCR("convert circle to polygon");
DATA(insert OID = 1573 ( polygon PGUID 14 f t t 1 f 604 "718" 100 0 0 100 "select circle_poly(12, $1)" - ));
DESCR("convert circle to 12-vertex polygon"); DESCR("convert circle to 12-vertex polygon");
DATA(insert OID = 1574 ( points PGUID 11 f t t 1 f 23 "604" 100 0 0 100 poly_npoints - )); DATA(insert OID = 1545 ( npoints PGUID 11 f t t 1 f 23 "602" 100 0 0 100 path_npoints - ));
DESCR(""); DESCR("# points in path");
DATA(insert OID = 1575 ( center PGUID 11 f t t 1 f 600 "604" 100 0 0 100 poly_center - )); DATA(insert OID = 1556 ( npoints PGUID 11 f t t 1 f 23 "604" 100 0 0 100 poly_npoints - ));
DESCR(""); DESCR("number of points in polygon");
DATA(insert OID = 1576 ( length PGUID 11 f t t 1 f 701 "601" 100 0 1 0 lseg_length - )); DATA(insert OID = 1573 ( int8 PGUID 14 f t t 1 f 20 "20" 100 0 0 100 "select $1" - ));
DESCR("distance between endpoints");
DATA(insert OID = 1579 ( circle PGUID 11 f t t 1 f 718 "603" 100 0 0 100 box_circle - ));
DESCR("convert box to circle");
DATA(insert OID = 1580 ( circle PGUID 11 f t t 1 f 718 "604" 100 0 0 100 poly_circle - ));
DESCR("convert polygon to circle");
DATA(insert OID = 1581 ( center PGUID 11 f t t 1 f 600 "718" 100 0 0 100 circle_center - ));
DESCR("center of circle");
DATA(insert OID = 1582 ( radius PGUID 11 f t t 1 f 701 "718" 100 0 0 100 circle_radius - ));
DESCR("radius of circle");
DATA(insert OID = 1583 ( diameter PGUID 11 f t t 1 f 701 "718" 100 0 0 100 circle_diameter - ));
DESCR("diameter of circle");
DATA(insert OID = 1584 ( area PGUID 11 f t t 1 f 701 "718" 100 0 0 100 circle_area - ));
DESCR("area of circle");
DATA(insert OID = 1592 ( int8 PGUID 14 f t t 1 f 20 "20" 100 0 0 100 "select $1" - ));
DESCR("convert int8 to int8 (no-op)"); DESCR("convert int8 to int8 (no-op)");
DATA(insert OID = 1593 ( int8 PGUID 11 f t t 1 f 20 "23" 100 0 0 100 int48 - ));
DESCR("convert int4 to int8");
DATA(insert OID = 1594 ( int8 PGUID 11 f t t 1 f 20 "701" 100 0 0 100 dtoi8 - ));
DESCR("convert float8 to int8");
DATA(insert OID = 1595 ( int4 PGUID 11 f t t 1 f 23 "20" 100 0 0 100 int84 - ));
DESCR("convert int8 to int4");
DATA(insert OID = 1596 ( float8 PGUID 11 f t t 1 f 701 "20" 100 0 0 100 i8tod - ));
DESCR("convert int8 to float8");
/* OIDS 1600 - 1699 */ DATA(insert OID = 1569 ( like PGUID 11 f t t 2 f 16 "25 25" 100 0 1 0 textlike - ));
DESCR("matches LIKE expression");
DATA(insert OID = 1570 ( notlike PGUID 11 f t t 2 f 16 "25 25" 100 0 1 0 textnlike - ));
DESCR("does not match LIKE expression");
DATA(insert OID = 1571 ( like PGUID 11 f t t 2 f 16 "19 25" 100 0 0 100 namelike - ));
DESCR("matches LIKE expression");
DATA(insert OID = 1572 ( notlike PGUID 11 f t t 2 f 16 "19 25" 100 0 0 100 namenlike - ));
DESCR("does not match LIKE expression");
DATA(insert OID = 1600 ( line PGUID 11 f t t 2 f 628 "600 600" 100 0 0 100 line_construct_pp - )); /* SEQUENCEs nextval & currval functions */
DESCR("points to line"); DATA(insert OID = 1574 ( nextval PGUID 11 f t f 1 f 23 "25" 100 0 0 100 nextval - ));
DATA(insert OID = 1601 ( ishorizontal PGUID 11 f t t 1 f 16 "628" 100 0 0 100 line_horizontal - )); DESCR("sequence next value");
DESCR("is line horizontal?"); DATA(insert OID = 1575 ( currval PGUID 11 f t f 1 f 23 "25" 100 0 0 100 currval - ));
DATA(insert OID = 1602 ( isvertical PGUID 11 f t t 1 f 16 "628" 100 0 0 100 line_vertical - )); DESCR("sequence current value");
DESCR("is line vertical?"); DATA(insert OID = 1576 ( setval PGUID 11 f t f 2 f 23 "25 23" 100 0 0 100 setval - ));
DATA(insert OID = 1603 ( isparallel PGUID 11 f t t 2 f 16 "628 628" 100 0 0 100 line_parallel - )); DESCR("sequence set value");
DESCR("are lines parallel?");
DATA(insert OID = 1604 ( float8 PGUID 11 f t t 1 f 701 "25" 100 0 0 100 text_float8 - )); /* OIDS 1600 - 1699 */
DESCR("convert text to float8");
DATA(insert OID = 1605 ( float4 PGUID 11 f t t 1 f 700 "25" 100 0 0 100 text_float4 - ));
DESCR("convert text to float4");
DATA(insert OID = 1606 ( text PGUID 11 f t t 1 f 25 "701" 100 0 0 100 float8_text - ));
DESCR("convert float8 to text");
DATA(insert OID = 1607 ( text PGUID 11 f t t 1 f 25 "700" 100 0 0 100 float4_text - ));
DESCR("convert float4 to text");
DATA(insert OID = 1619 ( varchar PGUID 11 f t t 1 f 1043 "23" 100 0 0 100 int4_text - )); DATA(insert OID = 1619 ( varchar PGUID 11 f t t 1 f 1043 "23" 100 0 0 100 int4_text - ));
DESCR("convert int4 to varchar"); DESCR("convert int4 to varchar");
DATA(insert OID = 1620 ( int4 PGUID 11 f t t 1 f 23 "1043" 100 0 0 100 text_int4 - ));
DESCR("convert varchar to int4");
DATA(insert OID = 1621 ( text PGUID 11 f t t 1 f 25 "20" 100 0 0 100 int8_text - ));
DESCR("convert int8 to text");
DATA(insert OID = 1622 ( int8 PGUID 11 f t t 1 f 20 "25" 100 0 0 100 text_int8 - ));
DESCR("convert text to int8");
DATA(insert OID = 1623 ( varchar PGUID 11 f t t 1 f 1043 "20" 100 0 0 100 int8_text - )); DATA(insert OID = 1623 ( varchar PGUID 11 f t t 1 f 1043 "20" 100 0 0 100 int8_text - ));
DESCR("convert int8 to varchar"); DESCR("convert int8 to varchar");
DATA(insert OID = 1624 ( int8 PGUID 11 f t t 1 f 20 "1043" 100 0 0 100 text_int8 - ));
DESCR("convert varchar to int8"); /* OID's 1625 - 1639 LZTEXT data type */
DATA(insert OID = 1626 ( lztextin PGUID 11 f t t 1 f 1625 "0" 100 0 0 100 lztextin - ));
DESCR("(internal)");
DATA(insert OID = 1627 ( lztextout PGUID 11 f t t 1 f 23 "0" 100 0 0 100 lztextout - ));
DESCR("(internal)");
DATA(insert OID = 1629 ( text PGUID 11 f t t 1 f 25 "1625" 100 0 0 100 lztext_text -));
DESCR("convert lztext to text");
DATA(insert OID = 1631 ( lztext PGUID 11 f t t 1 f 1625 "25" 100 0 0 100 text_lztext -));
DESCR("convert text to lztext");
DATA(insert OID = 1632 ( lztext PGUID 14 f t t 1 f 1625 "1625" 100 0 0 100 "select $1" -));
DESCR("convert text to lztext");
DATA(insert OID = 1633 ( char_length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextlen - ));
DESCR("length");
DATA(insert OID = 1634 ( length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextlen - ));
DESCR("length");
DATA(insert OID = 1635 ( octet_length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextoctetlen - ));
DESCR("octet length");
DATA(insert OID = 1636 ( lztext_cmp PGUID 11 f t t 2 f 23 "1625 1625" 100 0 1 0 lztext_cmp - ));
DESCR("compare lztext");
DATA(insert OID = 1637 ( lztext_eq PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_eq - ));
DESCR("equal");
DATA(insert OID = 1638 ( lztext_ne PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ne - ));
DESCR("not equal");
DATA(insert OID = 1639 ( lztext_gt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_gt - ));
DESCR("greater-than");
DATA(insert OID = 1664 ( lztext_ge PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ge - ));
DESCR("greater-than-or-equal");
DATA(insert OID = 1665 ( lztext_lt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_lt - ));
DESCR("less-than");
DATA(insert OID = 1656 ( lztext_le PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_le - ));
DESCR("less-than-or-equal");
/* Oracle Compatibility Related Functions - By Edmund Mergl <E.Mergl@bawue.de> */ /* Oracle Compatibility Related Functions - By Edmund Mergl <E.Mergl@bawue.de> */
DATA(insert OID = 868 ( strpos PGUID 11 f t t 2 f 23 "25 25" 100 0 0 100 textpos - )); DATA(insert OID = 868 ( strpos PGUID 11 f t t 2 f 23 "25 25" 100 0 0 100 textpos - ));
...@@ -2058,7 +2058,7 @@ DATA(insert OID = 876 ( rtrim PGUID 11 f t t 2 f 25 "25 25" 100 0 0 100 r ...@@ -2058,7 +2058,7 @@ DATA(insert OID = 876 ( rtrim PGUID 11 f t t 2 f 25 "25 25" 100 0 0 100 r
DESCR("right-pad string to length"); DESCR("right-pad string to length");
DATA(insert OID = 877 ( substr PGUID 11 f t t 3 f 25 "25 23 23" 100 0 0 100 text_substr - )); DATA(insert OID = 877 ( substr PGUID 11 f t t 3 f 25 "25 23 23" 100 0 0 100 text_substr - ));
DESCR("return portion of string"); DESCR("return portion of string");
DATA(insert OID = 878 ( translate PGUID 11 f t t 3 f 25 "25 18 18" 100 0 0 100 translate - )); DATA(insert OID = 878 ( translate PGUID 11 f t t 3 f 25 "25 25 25" 100 0 0 100 translate - ));
DESCR("modify string by substring replacement"); DESCR("modify string by substring replacement");
DATA(insert OID = 879 ( lpad PGUID 14 f t t 2 f 25 "25 23" 100 0 0 100 "select lpad($1, $2, \' \')" - )); DATA(insert OID = 879 ( lpad PGUID 14 f t t 2 f 25 "25 23" 100 0 0 100 "select lpad($1, $2, \' \')" - ));
DESCR("left-pad string to length"); DESCR("left-pad string to length");
...@@ -2068,22 +2068,13 @@ DATA(insert OID = 881 ( ltrim PGUID 14 f t t 1 f 25 "25" 100 0 0 100 "sel ...@@ -2068,22 +2068,13 @@ DATA(insert OID = 881 ( ltrim PGUID 14 f t t 1 f 25 "25" 100 0 0 100 "sel
DESCR("remove initial characters from string"); DESCR("remove initial characters from string");
DATA(insert OID = 882 ( rtrim PGUID 14 f t t 1 f 25 "25" 100 0 0 100 "select rtrim($1, \' \')" - )); DATA(insert OID = 882 ( rtrim PGUID 14 f t t 1 f 25 "25" 100 0 0 100 "select rtrim($1, \' \')" - ));
DESCR("remove trailing characters from string"); DESCR("remove trailing characters from string");
DATA(insert OID = 883 ( substr PGUID 14 f t t 2 f 25 "25 23" 100 0 0 100 "select text_substr($1, $2, -1)" - )); DATA(insert OID = 883 ( substr PGUID 14 f t t 2 f 25 "25 23" 100 0 0 100 "select substr($1, $2, -1)" - ));
DESCR("return portion of string"); DESCR("return portion of string");
DATA(insert OID = 884 ( btrim PGUID 11 f t t 2 f 25 "25 25" 100 0 0 100 btrim - )); DATA(insert OID = 884 ( btrim PGUID 11 f t t 2 f 25 "25 25" 100 0 0 100 btrim - ));
DESCR("trim both ends of string"); DESCR("trim both ends of string");
DATA(insert OID = 885 ( btrim PGUID 14 f t t 1 f 25 "25" 100 0 0 100 "select btrim($1, \' \')" - )); DATA(insert OID = 885 ( btrim PGUID 14 f t t 1 f 25 "25" 100 0 0 100 "select btrim($1, \' \')" - ));
DESCR("trim both ends of string"); DESCR("trim both ends of string");
/* SEQUENCEs nextval & currval functions */
DATA(insert OID = 1317 ( nextval PGUID 11 f t f 1 f 23 "25" 100 0 0 100 nextval - ));
DESCR("sequence next value");
DATA(insert OID = 1319 ( currval PGUID 11 f t f 1 f 23 "25" 100 0 0 100 currval - ));
DESCR("sequence current value");
DATA(insert OID = 1618 ( setval PGUID 11 f t f 2 f 23 "25 23" 100 0 0 100 setval - ));
DESCR("sequence set value");
/* for multi-byte support */ /* for multi-byte support */
DATA(insert OID = 1039 ( getdatabaseencoding PGUID 11 f t f 0 f 19 "0" 100 0 0 100 getdatabaseencoding - )); DATA(insert OID = 1039 ( getdatabaseencoding PGUID 11 f t f 0 f 19 "0" 100 0 0 100 getdatabaseencoding - ));
DESCR("encoding name of current database"); DESCR("encoding name of current database");
...@@ -2162,7 +2153,7 @@ DESCR("(internal)"); ...@@ -2162,7 +2153,7 @@ DESCR("(internal)");
/* for cidr type support */ /* for cidr type support */
DATA(insert OID = 1267 ( cidr_in PGUID 11 f t t 1 f 650 "0" 100 0 0 100 cidr_in - )); DATA(insert OID = 1267 ( cidr_in PGUID 11 f t t 1 f 650 "0" 100 0 0 100 cidr_in - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1416 ( cidr_out PGUID 11 f t t 1 f 23 "0" 100 0 0 100 cidr_out - )); DATA(insert OID = 1427 ( cidr_out PGUID 11 f t t 1 f 23 "0" 100 0 0 100 cidr_out - ));
DESCR("(internal)"); DESCR("(internal)");
/* these are used for both inet and cidr */ /* these are used for both inet and cidr */
...@@ -2190,18 +2181,6 @@ DATA(insert OID = 930 ( network_supeq PGUID 11 f t t 2 f 16 "869 869" 100 0 ...@@ -2190,18 +2181,6 @@ DATA(insert OID = 930 ( network_supeq PGUID 11 f t t 2 f 16 "869 869" 100 0
DESCR("is-supernet-or-equal"); DESCR("is-supernet-or-equal");
/* inet/cidr versions */ /* inet/cidr versions */
DATA(insert OID = 940 ( network_netmask PGUID 11 f t t 1 f 25 "869" 100 0 0 100 network_netmask - ));
DESCR("netmask of address");
DATA(insert OID = 941 ( network_masklen PGUID 11 f t t 1 f 23 "869" 100 0 0 100 network_masklen - ));
DESCR("netmask length");
DATA(insert OID = 945 ( network_broadcast PGUID 11 f t t 1 f 25 "869" 100 0 0 100 network_broadcast - ));
DESCR("broadcast address");
DATA(insert OID = 682 ( network_host PGUID 11 f t t 1 f 25 "869" 100 0 0 100 network_host - ));
DESCR("host address");
DATA(insert OID = 473 ( network_network PGUID 11 f t t 1 f 25 "869" 100 0 0 100 network_network - ));
DESCR("network address");
/* shortcut names */
DATA(insert OID = 696 ( netmask PGUID 11 f t t 1 f 25 "869" 100 0 0 100 network_netmask - )); DATA(insert OID = 696 ( netmask PGUID 11 f t t 1 f 25 "869" 100 0 0 100 network_netmask - ));
DESCR("netmask of address"); DESCR("netmask of address");
DATA(insert OID = 697 ( masklen PGUID 11 f t t 1 f 23 "869" 100 0 0 100 network_masklen - )); DATA(insert OID = 697 ( masklen PGUID 11 f t t 1 f 23 "869" 100 0 0 100 network_masklen - ));
...@@ -2231,29 +2210,19 @@ DATA(insert OID = 1704 ( numeric_abs PGUID 11 f t t 1 f 1700 "1700" 100 0 0 10 ...@@ -2231,29 +2210,19 @@ DATA(insert OID = 1704 ( numeric_abs PGUID 11 f t t 1 f 1700 "1700" 100 0 0 10
DESCR("absolute value"); DESCR("absolute value");
DATA(insert OID = 1705 ( abs PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_abs - )); DATA(insert OID = 1705 ( abs PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_abs - ));
DESCR("absolute value"); DESCR("absolute value");
DATA(insert OID = 1706 ( numeric_sign PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_sign - )); DATA(insert OID = 1706 ( sign PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_sign - ));
DESCR("sign of value");
DATA(insert OID = 1707 ( sign PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_sign - ));
DESCR("sign of value"); DESCR("sign of value");
DATA(insert OID = 1708 ( numeric_round PGUID 11 f t t 2 f 1700 "1700 23" 100 0 0 100 numeric_round - )); DATA(insert OID = 1707 ( round PGUID 11 f t t 2 f 1700 "1700 23" 100 0 0 100 numeric_round - ));
DESCR("value rounded to 'scale'");
DATA(insert OID = 1709 ( round PGUID 11 f t t 2 f 1700 "1700 23" 100 0 0 100 numeric_round - ));
DESCR("value rounded to 'scale'"); DESCR("value rounded to 'scale'");
DATA(insert OID = 1710 ( round PGUID 14 f t t 1 f 1700 "1700" 100 0 0 100 "select numeric_round($1,0)" - )); DATA(insert OID = 1708 ( round PGUID 14 f t t 1 f 1700 "1700" 100 0 0 100 "select numeric_round($1,0)" - ));
DESCR("value rounded to 'scale' of zero"); DESCR("value rounded to 'scale' of zero");
DATA(insert OID = 1711 ( numeric_trunc PGUID 11 f t t 2 f 1700 "1700 23" 100 0 0 100 numeric_trunc - )); DATA(insert OID = 1709 ( trunc PGUID 11 f t t 2 f 1700 "1700 23" 100 0 0 100 numeric_trunc - ));
DESCR("value truncated to 'scale'"); DESCR("value truncated to 'scale'");
DATA(insert OID = 1712 ( trunc PGUID 11 f t t 2 f 1700 "1700 23" 100 0 0 100 numeric_trunc - )); DATA(insert OID = 1710 ( trunc PGUID 14 f t t 1 f 1700 "1700" 100 0 0 100 "select numeric_trunc($1,0)" - ));
DESCR("value truncated to 'scale'");
DATA(insert OID = 1713 ( trunc PGUID 14 f t t 1 f 1700 "1700" 100 0 0 100 "select numeric_trunc($1,0)" - ));
DESCR("value truncated to 'scale' of zero"); DESCR("value truncated to 'scale' of zero");
DATA(insert OID = 1714 ( numeric_ceil PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_ceil - )); DATA(insert OID = 1711 ( ceil PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_ceil - ));
DESCR("smallest integer >= value");
DATA(insert OID = 1715 ( ceil PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_ceil - ));
DESCR("smallest integer >= value"); DESCR("smallest integer >= value");
DATA(insert OID = 1716 ( numeric_floor PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_floor - )); DATA(insert OID = 1712 ( floor PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_floor - ));
DESCR("largest integer <= value");
DATA(insert OID = 1717 ( floor PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_floor - ));
DESCR("largest integer <= value"); DESCR("largest integer <= value");
DATA(insert OID = 1718 ( numeric_eq PGUID 11 f t t 2 f 16 "1700 1700" 100 0 0 100 numeric_eq - )); DATA(insert OID = 1718 ( numeric_eq PGUID 11 f t t 2 f 16 "1700 1700" 100 0 0 100 numeric_eq - ));
DESCR("equal"); DESCR("equal");
...@@ -2275,53 +2244,43 @@ DATA(insert OID = 1726 ( numeric_mul PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 ...@@ -2275,53 +2244,43 @@ DATA(insert OID = 1726 ( numeric_mul PGUID 11 f t t 2 f 1700 "1700 1700" 100 0
DESCR("multiply"); DESCR("multiply");
DATA(insert OID = 1727 ( numeric_div PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_div - )); DATA(insert OID = 1727 ( numeric_div PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_div - ));
DESCR("divide"); DESCR("divide");
DATA(insert OID = 1728 ( numeric_mod PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mod - )); DATA(insert OID = 1728 ( mod PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 1729 ( mod PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mod - )); DATA(insert OID = 1729 ( numeric_mod PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mod - ));
DESCR("modulus"); DESCR("modulus");
DATA(insert OID = 1730 ( numeric_sqrt PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_sqrt - )); DATA(insert OID = 1730 ( sqrt PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_sqrt - ));
DESCR("square root"); DESCR("square root");
DATA(insert OID = 1731 ( sqrt PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_sqrt - )); DATA(insert OID = 1731 ( numeric_sqrt PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_sqrt - ));
DESCR("square root"); DESCR("square root");
DATA(insert OID = 1732 ( numeric_exp PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_exp - )); DATA(insert OID = 1732 ( exp PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_exp - ));
DESCR("e raised to the power of n"); DESCR("e raised to the power of n");
DATA(insert OID = 1733 ( exp PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_exp - )); DATA(insert OID = 1733 ( numeric_exp PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_exp - ));
DESCR("e raised to the power of n"); DESCR("e raised to the power of n");
DATA(insert OID = 1734 ( numeric_ln PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_ln - )); DATA(insert OID = 1734 ( ln PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_ln - ));
DESCR("natural logarithm of n"); DESCR("natural logarithm of n");
DATA(insert OID = 1735 ( ln PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_ln - )); DATA(insert OID = 1735 ( numeric_ln PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_ln - ));
DESCR("natural logarithm of n"); DESCR("natural logarithm of n");
DATA(insert OID = 1736 ( numeric_log PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_log - )); DATA(insert OID = 1736 ( log PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_log - ));
DESCR("logarithm base m of n"); DESCR("logarithm base m of n");
DATA(insert OID = 1737 ( log PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_log - )); DATA(insert OID = 1737 ( numeric_log PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_log - ));
DESCR("logarithm base m of n"); DESCR("logarithm base m of n");
DATA(insert OID = 1738 ( numeric_power PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_power - )); DATA(insert OID = 1738 ( pow PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_power - ));
DESCR("m raised to the power of n"); DESCR("m raised to the power of n");
DATA(insert OID = 1739 ( power PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_power - )); DATA(insert OID = 1739 ( numeric_power PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_power - ));
DESCR("m raised to the power of n"); DESCR("m raised to the power of n");
DATA(insert OID = 1740 ( int4_numeric PGUID 11 f t t 1 f 1700 "23" 100 0 0 100 int4_numeric - )); DATA(insert OID = 1740 ( numeric PGUID 11 f t t 1 f 1700 "23" 100 0 0 100 int4_numeric - ));
DESCR("(internal)");
DATA(insert OID = 1741 ( numeric PGUID 11 f t t 1 f 1700 "23" 100 0 0 100 int4_numeric - ));
DESCR("(internal)");
DATA(insert OID = 1742 ( float4_numeric PGUID 11 f t t 1 f 1700 "700" 100 0 0 100 float4_numeric - ));
DESCR("(internal)");
DATA(insert OID = 1743 ( numeric PGUID 11 f t t 1 f 1700 "700" 100 0 0 100 float4_numeric - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1744 ( float8_numeric PGUID 11 f t t 1 f 1700 "701" 100 0 0 100 float8_numeric - )); DATA(insert OID = 1741 ( log PGUID 14 f t t 1 f 1700 "1700" 100 0 0 100 "select(10, $1)" - ));
DESCR("(internal)"); DESCR("logarithm base m of n");
DATA(insert OID = 1745 ( numeric PGUID 11 f t t 1 f 1700 "701" 100 0 0 100 float8_numeric - )); DATA(insert OID = 1742 ( numeric PGUID 11 f t t 1 f 1700 "700" 100 0 0 100 float4_numeric - ));
DESCR("(internal)");
DATA(insert OID = 1746 ( numeric_int4 PGUID 11 f t t 1 f 23 "1700" 100 0 0 100 numeric_int4 - ));
DESCR("(internal)");
DATA(insert OID = 1747 ( int4 PGUID 11 f t t 1 f 23 "1700" 100 0 0 100 numeric_int4 - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1748 ( numeric_float4 PGUID 11 f t t 1 f 700 "1700" 100 0 0 100 numeric_float4 - )); DATA(insert OID = 1743 ( numeric PGUID 11 f t t 1 f 1700 "701" 100 0 0 100 float8_numeric - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1749 ( float4 PGUID 11 f t t 1 f 700 "1700" 100 0 0 100 numeric_float4 - )); DATA(insert OID = 1744 ( int4 PGUID 11 f t t 1 f 23 "1700" 100 0 0 100 numeric_int4 - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1750 ( numeric_float8 PGUID 11 f t t 1 f 701 "1700" 100 0 0 100 numeric_float8 - )); DATA(insert OID = 1745 ( float4 PGUID 11 f t t 1 f 700 "1700" 100 0 0 100 numeric_float4 - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1751 ( float8 PGUID 11 f t t 1 f 701 "1700" 100 0 0 100 numeric_float8 - )); DATA(insert OID = 1746 ( float8 PGUID 11 f t t 1 f 701 "1700" 100 0 0 100 numeric_float8 - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1764 ( numeric_inc PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_inc - )); DATA(insert OID = 1764 ( numeric_inc PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_inc - ));
DESCR("increment by one"); DESCR("increment by one");
...@@ -2335,72 +2294,28 @@ DATA(insert OID = 1769 ( numeric_cmp PGUID 11 f t t 2 f 23 "1700 1700" 100 0 0 ...@@ -2335,72 +2294,28 @@ DATA(insert OID = 1769 ( numeric_cmp PGUID 11 f t t 2 f 23 "1700 1700" 100 0 0
DESCR("compare two numbers"); DESCR("compare two numbers");
DATA(insert OID = 1771 ( numeric_uminus PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_uminus - )); DATA(insert OID = 1771 ( numeric_uminus PGUID 11 f t t 1 f 1700 "1700" 100 0 0 100 numeric_uminus - ));
DESCR("negate"); DESCR("negate");
DATA(insert OID = 1779 ( int8_numeric PGUID 11 f t t 1 f 1700 "20" 100 0 0 100 int8_numeric - )); DATA(insert OID = 1779 ( int8 PGUID 11 f t t 1 f 20 "1700" 100 0 0 100 numeric_int8 - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1781 ( numeric PGUID 11 f t t 1 f 1700 "20" 100 0 0 100 int8_numeric - )); DATA(insert OID = 1781 ( numeric PGUID 11 f t t 1 f 1700 "20" 100 0 0 100 int8_numeric - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1782 ( numeric_int8 PGUID 11 f t t 1 f 20 "1700" 100 0 0 100 numeric_int8 - )); DATA(insert OID = 1782 ( numeric PGUID 11 f t t 1 f 1700 "21" 100 0 0 100 int2_numeric - ));
DESCR("(internal)");
DATA(insert OID = 1783 ( int8 PGUID 11 f t t 1 f 20 "1700" 100 0 0 100 numeric_int8 - ));
DESCR("(internal)"); DESCR("(internal)");
DATA(insert OID = 1784 ( int2_numeric PGUID 11 f t t 1 f 1700 "21" 100 0 0 100 int2_numeric - )); DATA(insert OID = 1783 ( int2 PGUID 11 f t t 1 f 21 "1700" 100 0 0 100 numeric_int2 - ));
DESCR("(internal)");
DATA(insert OID = 1785 ( numeric PGUID 11 f t t 1 f 1700 "21" 100 0 0 100 int2_numeric - ));
DESCR("(internal)");
DATA(insert OID = 1786 ( numeric_int2 PGUID 11 f t t 1 f 21 "1700" 100 0 0 100 numeric_int2 - ));
DESCR("(internal)");
DATA(insert OID = 1787 ( int2 PGUID 11 f t t 1 f 21 "1700" 100 0 0 100 numeric_int2 - ));
DESCR("(internal)"); DESCR("(internal)");
/* OID's 1625 - 1639 LZTEXT data type */
DATA(insert OID = 1626 ( lztextin PGUID 11 f t t 1 f 1625 "0" 100 0 0 100 lztextin - ));
DESCR("(internal)");
DATA(insert OID = 1627 ( lztextout PGUID 11 f t t 1 f 23 "0" 100 0 0 100 lztextout - ));
DESCR("(internal)");
DATA(insert OID = 1628 ( lztext_text PGUID 11 f t t 1 f 25 "1625" 100 0 0 100 lztext_text -));
DESCR("convert lztext to text");
DATA(insert OID = 1629 ( text PGUID 11 f t t 1 f 25 "1625" 100 0 0 100 lztext_text -));
DESCR("convert lztext to text");
DATA(insert OID = 1630 ( text_lztext PGUID 11 f t t 1 f 1625 "25" 100 0 0 100 text_lztext -));
DESCR("convert text to lztext");
DATA(insert OID = 1631 ( lztext PGUID 11 f t t 1 f 1625 "25" 100 0 0 100 text_lztext -));
DESCR("convert text to lztext");
DATA(insert OID = 1632 ( lztextlen PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextlen - ));
DESCR("length");
DATA(insert OID = 1633 ( length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextlen - ));
DESCR("length");
DATA(insert OID = 1634 ( lztextoctetlen PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextoctetlen - ));
DESCR("octet length");
DATA(insert OID = 1635 ( octet_length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextoctetlen - ));
DESCR("octet length");
DATA(insert OID = 1636 ( lztext_cmp PGUID 11 f t t 2 f 23 "1625 1625" 100 0 1 0 lztext_cmp - ));
DESCR("compare lztext vs. lztext");
DATA(insert OID = 1637 ( lztext_eq PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_eq - ));
DESCR("equal");
DATA(insert OID = 1638 ( lztext_ne PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ne - ));
DESCR("not equal");
DATA(insert OID = 1639 ( lztext_gt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_gt - ));
DESCR("greater-than");
DATA(insert OID = 1664 ( lztext_ge PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ge - ));
DESCR("greater-than-or-equal");
DATA(insert OID = 1665 ( lztext_lt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_lt - ));
DESCR("lower-than");
DATA(insert OID = 1656 ( lztext_le PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_le - ));
DESCR("lower-than-or-equal");
/* formatting */ /* formatting */
DATA(insert OID = 1770 ( to_char PGUID 11 f t f 2 f 25 "1184 25" 100 0 0 100 timestamp_to_char - )); DATA(insert OID = 1770 ( to_char PGUID 11 f t f 2 f 25 "1184 25" 100 0 0 100 timestamp_to_char - ));
DESCR("convert / formatting timestamp to text"); DESCR("format timestamp to text");
DATA(insert OID = 1772 ( to_char PGUID 11 f t f 2 f 25 "1700 25" 100 0 0 100 numeric_to_char - )); DATA(insert OID = 1772 ( to_char PGUID 11 f t f 2 f 25 "1700 25" 100 0 0 100 numeric_to_char - ));
DESCR("convert / formatting numeric to text"); DESCR("format numeric to text");
DATA(insert OID = 1773 ( to_char PGUID 11 f t f 2 f 25 "23 25" 100 0 0 100 int4_to_char - )); DATA(insert OID = 1773 ( to_char PGUID 11 f t f 2 f 25 "23 25" 100 0 0 100 int4_to_char - ));
DESCR("convert / formatting int4 to text"); DESCR("format int4 to text");
DATA(insert OID = 1774 ( to_char PGUID 11 f t f 2 f 25 "20 25" 100 0 0 100 int8_to_char - )); DATA(insert OID = 1774 ( to_char PGUID 11 f t f 2 f 25 "20 25" 100 0 0 100 int8_to_char - ));
DESCR("convert / formatting int8 to text"); DESCR("format int8 to text");
DATA(insert OID = 1775 ( to_char PGUID 11 f t f 2 f 25 "700 25" 100 0 0 100 float4_to_char - )); DATA(insert OID = 1775 ( to_char PGUID 11 f t f 2 f 25 "700 25" 100 0 0 100 float4_to_char - ));
DESCR("convert / formatting float4 to text"); DESCR("format float4 to text");
DATA(insert OID = 1776 ( to_char PGUID 11 f t f 2 f 25 "701 25" 100 0 0 100 float8_to_char - )); DATA(insert OID = 1776 ( to_char PGUID 11 f t f 2 f 25 "701 25" 100 0 0 100 float8_to_char - ));
DESCR("convert / formatting float8 to text"); DESCR("format float8 to text");
DATA(insert OID = 1777 ( to_number PGUID 11 f t f 2 f 1700 "25 25" 100 0 0 100 numeric_to_number - )); DATA(insert OID = 1777 ( to_number PGUID 11 f t f 2 f 1700 "25 25" 100 0 0 100 numeric_to_number - ));
DESCR("convert text to numeric"); DESCR("convert text to numeric");
DATA(insert OID = 1778 ( to_timestamp PGUID 11 f t f 2 f 1184 "25 25" 100 0 0 100 to_timestamp - )); DATA(insert OID = 1778 ( to_timestamp PGUID 11 f t f 2 f 1184 "25 25" 100 0 0 100 to_timestamp - ));
...@@ -2429,3 +2344,4 @@ extern Oid ProcedureCreate(char *procedureName, ...@@ -2429,3 +2344,4 @@ extern Oid ProcedureCreate(char *procedureName,
#endif /* PG_PROC_H */ #endif /* PG_PROC_H */
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_type.h,v 1.84 2000/02/27 12:02:34 wieck Exp $ * $Id: pg_type.h,v 1.85 2000/03/14 23:06:45 thomas Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -377,6 +377,10 @@ DATA(insert OID = 1187 ( _interval PGUID -1 -1 f b t \054 0 1186 array_in array ...@@ -377,6 +377,10 @@ DATA(insert OID = 1187 ( _interval PGUID -1 -1 f b t \054 0 1186 array_in array
/* OIDS 1200 - 1299 */ /* OIDS 1200 - 1299 */
DATA(insert OID = 1231 ( _numeric PGUID -1 -1 f b t \054 0 1700 array_in array_out array_in array_out i _null_ )); DATA(insert OID = 1231 ( _numeric PGUID -1 -1 f b t \054 0 1700 array_in array_out array_in array_out i _null_ ));
DATA(insert OID = 1266 ( timetz PGUID 12 22 f b t \054 0 0 timetz_in timetz_out timetz_in timetz_out d _null_ ));
DESCR("hh:mm:ss, ANSI SQL time");
#define TIMETZOID 1266
DATA(insert OID = 1270 ( _timetz PGUID -1 -1 f b t \054 0 1266 array_in array_out array_in array_out d _null_ ));
/* OIDS 1700 - 1799 */ /* OIDS 1700 - 1799 */
DATA(insert OID = 1700 ( numeric PGUID -1 -1 f b t \054 0 0 numeric_in numeric_out numeric_in numeric_out i _null_ )); DATA(insert OID = 1700 ( numeric PGUID -1 -1 f b t \054 0 0 numeric_in numeric_out numeric_in numeric_out i _null_ ));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: parsenodes.h,v 1.101 2000/03/01 05:18:18 tgl Exp $ * $Id: parsenodes.h,v 1.102 2000/03/14 23:06:47 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -614,6 +614,7 @@ typedef struct ViewStmt ...@@ -614,6 +614,7 @@ typedef struct ViewStmt
{ {
NodeTag type; NodeTag type;
char *viewname; /* name of the view */ char *viewname; /* name of the view */
List *aliases; /* target column names */
Query *query; /* the SQL statement */ Query *query; /* the SQL statement */
} ViewStmt; } ViewStmt;
...@@ -1131,6 +1132,12 @@ typedef struct TargetEntry ...@@ -1131,6 +1132,12 @@ typedef struct TargetEntry
* Some of the following are only used in one of * Some of the following are only used in one of
* the parsing, optimizing, execution stages. * the parsing, optimizing, execution stages.
* *
* eref is the expanded table name and columns for the underlying
* relation. Note that for outer join syntax, allowed reference names
* could be modified as one evaluates the nested clauses (e.g.
* "SELECT ... FROM t1 NATURAL JOIN t2 WHERE ..." forbids explicit mention
* of a table name in any reference to the join column.
*
* inFromCl marks those range variables that are listed in the FROM clause. * inFromCl marks those range variables that are listed in the FROM clause.
* In SQL, the query can only refer to range variables listed in the * In SQL, the query can only refer to range variables listed in the
* FROM clause, but POSTQUEL allows you to refer to tables not listed, * FROM clause, but POSTQUEL allows you to refer to tables not listed,
...@@ -1157,9 +1164,8 @@ typedef struct RangeTblEntry ...@@ -1157,9 +1164,8 @@ typedef struct RangeTblEntry
{ {
NodeTag type; NodeTag type;
char *relname; /* real name of the relation */ char *relname; /* real name of the relation */
#ifndef DISABLE_JOIN_SYNTAX
Attr *ref; /* reference names (given in FROM clause) */ Attr *ref; /* reference names (given in FROM clause) */
#endif Attr *eref; /* expanded reference names */
Oid relid; /* OID of the relation */ Oid relid; /* OID of the relation */
bool inh; /* inheritance requested? */ bool inh; /* inheritance requested? */
bool inFromCl; /* present in FROM clause */ bool inFromCl; /* present in FROM clause */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: parse_coerce.h,v 1.18 2000/02/16 17:26:16 thomas Exp $ * $Id: parse_coerce.h,v 1.19 2000/03/14 23:06:48 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -53,6 +53,9 @@ typedef enum CATEGORY ...@@ -53,6 +53,9 @@ typedef enum CATEGORY
|| ((t) == INTERVALOID) \ || ((t) == INTERVALOID) \
|| ((t) == ABSTIMEOID) \ || ((t) == ABSTIMEOID) \
|| ((t) == RELTIMEOID) \ || ((t) == RELTIMEOID) \
|| ((t) == DATEOID) \
|| ((t) == TIMEOID) \
|| ((t) == TIMETZOID) \
|| ((t) == CHAROID) \ || ((t) == CHAROID) \
|| ((t) == NAMEOID) \ || ((t) == NAMEOID) \
|| ((t) == CASHOID) \ || ((t) == CASHOID) \
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: builtins.h,v 1.105 2000/02/27 12:02:34 wieck Exp $ * $Id: builtins.h,v 1.106 2000/03/14 23:06:50 thomas Exp $
* *
* NOTES * NOTES
* This should normally only be included by fmgr.h. * This should normally only be included by fmgr.h.
...@@ -116,12 +116,14 @@ extern int32 int4pl(int32 arg1, int32 arg2); ...@@ -116,12 +116,14 @@ extern int32 int4pl(int32 arg1, int32 arg2);
extern int32 int4mi(int32 arg1, int32 arg2); extern int32 int4mi(int32 arg1, int32 arg2);
extern int32 int4mul(int32 arg1, int32 arg2); extern int32 int4mul(int32 arg1, int32 arg2);
extern int32 int4div(int32 arg1, int32 arg2); extern int32 int4div(int32 arg1, int32 arg2);
extern int32 int4abs(int32 arg);
extern int32 int4inc(int32 arg); extern int32 int4inc(int32 arg);
extern int16 int2um(int16 arg); extern int16 int2um(int16 arg);
extern int16 int2pl(int16 arg1, int16 arg2); extern int16 int2pl(int16 arg1, int16 arg2);
extern int16 int2mi(int16 arg1, int16 arg2); extern int16 int2mi(int16 arg1, int16 arg2);
extern int16 int2mul(int16 arg1, int16 arg2); extern int16 int2mul(int16 arg1, int16 arg2);
extern int16 int2div(int16 arg1, int16 arg2); extern int16 int2div(int16 arg1, int16 arg2);
extern int16 int2abs(int16 arg);
extern int16 int2inc(int16 arg); extern int16 int2inc(int16 arg);
extern int32 int24pl(int32 arg1, int32 arg2); extern int32 int24pl(int32 arg1, int32 arg2);
extern int32 int24mi(int32 arg1, int32 arg2); extern int32 int24mi(int32 arg1, int32 arg2);
...@@ -268,6 +270,7 @@ extern float64 dcbrt(float64 arg1); ...@@ -268,6 +270,7 @@ extern float64 dcbrt(float64 arg1);
extern float64 dpow(float64 arg1, float64 arg2); extern float64 dpow(float64 arg1, float64 arg2);
extern float64 dexp(float64 arg1); extern float64 dexp(float64 arg1);
extern float64 dlog1(float64 arg1); extern float64 dlog1(float64 arg1);
extern float64 dlog10(float64 arg1);
extern float64 float48pl(float32 arg1, float64 arg2); extern float64 float48pl(float32 arg1, float64 arg2);
extern float64 float48mi(float32 arg1, float64 arg2); extern float64 float48mi(float32 arg1, float64 arg2);
extern float64 float48mul(float32 arg1, float64 arg2); extern float64 float48mul(float32 arg1, float64 arg2);
...@@ -468,9 +471,11 @@ extern text *upper(text *string); ...@@ -468,9 +471,11 @@ extern text *upper(text *string);
extern text *initcap(text *string); extern text *initcap(text *string);
extern text *lpad(text *string1, int4 len, text *string2); extern text *lpad(text *string1, int4 len, text *string2);
extern text *rpad(text *string1, int4 len, text *string2); extern text *rpad(text *string1, int4 len, text *string2);
extern text *btrim(text *string, text *set);
extern text *ltrim(text *string, text *set); extern text *ltrim(text *string, text *set);
extern text *rtrim(text *string, text *set); extern text *rtrim(text *string, text *set);
extern text *translate(text *string, char from, char to); extern text *substr(text *string, int4 m, int4 n);
extern text *translate(text *string, text *from, text *to);
/* acl.c */ /* acl.c */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: date.h,v 1.1 2000/02/16 17:26:26 thomas Exp $ * $Id: date.h,v 1.2 2000/03/14 23:06:50 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -18,6 +18,12 @@ typedef int32 DateADT; ...@@ -18,6 +18,12 @@ typedef int32 DateADT;
typedef float8 TimeADT; typedef float8 TimeADT;
typedef struct
{
double time; /* all time units other than months and years */
int4 zone; /* numeric time zone, in seconds */
} TimeTzADT;
/* date.c */ /* date.c */
extern DateADT date_in(char *datestr); extern DateADT date_in(char *datestr);
extern char *date_out(DateADT dateVal); extern char *date_out(DateADT dateVal);
...@@ -47,6 +53,30 @@ extern bool time_le(TimeADT *time1, TimeADT *time2); ...@@ -47,6 +53,30 @@ extern bool time_le(TimeADT *time1, TimeADT *time2);
extern bool time_gt(TimeADT *time1, TimeADT *time2); extern bool time_gt(TimeADT *time1, TimeADT *time2);
extern bool time_ge(TimeADT *time1, TimeADT *time2); extern bool time_ge(TimeADT *time1, TimeADT *time2);
extern int time_cmp(TimeADT *time1, TimeADT *time2); extern int time_cmp(TimeADT *time1, TimeADT *time2);
extern bool overlaps_time(TimeADT *time1, TimeADT *time2,
TimeADT *time3, TimeADT *time4);
extern TimeADT *time_larger(TimeADT *time1, TimeADT *time2);
extern TimeADT *time_smaller(TimeADT *time1, TimeADT *time2);
extern TimeADT *timestamp_time(Timestamp *timestamp); extern TimeADT *timestamp_time(Timestamp *timestamp);
extern Interval *time_interval(TimeADT *time);
extern TimeTzADT *timetz_in(char *timestr);
extern char *timetz_out(TimeTzADT *time);
extern bool timetz_eq(TimeTzADT *time1, TimeTzADT *time2);
extern bool timetz_ne(TimeTzADT *time1, TimeTzADT *time2);
extern bool timetz_lt(TimeTzADT *time1, TimeTzADT *time2);
extern bool timetz_le(TimeTzADT *time1, TimeTzADT *time2);
extern bool timetz_gt(TimeTzADT *time1, TimeTzADT *time2);
extern bool timetz_ge(TimeTzADT *time1, TimeTzADT *time2);
extern int timetz_cmp(TimeTzADT *time1, TimeTzADT *time2);
extern bool overlaps_timetz(TimeTzADT *time1, TimeTzADT *time2,
TimeTzADT *time3, TimeTzADT *time4);
extern TimeTzADT *timetz_larger(TimeTzADT *time1, TimeTzADT *time2);
extern TimeTzADT *timetz_smaller(TimeTzADT *time1, TimeTzADT *time2);
extern TimeTzADT *timestamp_timetz(Timestamp *timestamp);
extern Timestamp *datetimetz_timestamp(DateADT date, TimeTzADT *time);
#endif /* DATE_H */ #endif /* DATE_H */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: datetime.h,v 1.10 2000/02/16 17:26:26 thomas Exp $ * $Id: datetime.h,v 1.11 2000/03/14 23:06:50 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -21,32 +21,6 @@ ...@@ -21,32 +21,6 @@
#include <limits.h> #include <limits.h>
#include "utils/timestamp.h" #include "utils/timestamp.h"
#if 0
/*
* Timestamp represents absolute time.
* TimeSpan represents delta time. Keep track of months (and years)
* separately since the elapsed time spanned is unknown until instantiated
* relative to an absolute time.
*
* Note that Postgres uses "time interval" to mean a bounded interval,
* consisting of a beginning and ending time, not a time span - thomas 97/03/20
*/
typedef double Timestamp;
typedef struct
{
double time; /* all time units other than months and
* years */
int4 month; /* months and years, after time for
* alignment */
} TimeSpan;
#endif
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* time types + support macros * time types + support macros
...@@ -209,74 +183,6 @@ typedef struct ...@@ -209,74 +183,6 @@ typedef struct
} datetkn; } datetkn;
#if 0
#ifdef NAN
#define TIMESTAMP_INVALID (NAN)
#else
#define TIMESTAMP_INVALID (DBL_MIN+DBL_MIN)
#endif
#ifdef HUGE_VAL
#define TIMESTAMP_NOBEGIN (-HUGE_VAL)
#define TIMESTAMP_NOEND (HUGE_VAL)
#else
#define TIMESTAMP_NOBEGIN (-DBL_MAX)
#define TIMESTAMP_NOEND (DBL_MAX)
#endif
#define TIMESTAMP_CURRENT (DBL_MIN)
#define TIMESTAMP_EPOCH (-DBL_MIN)
#define TIMESTAMP_INVALID(j) {j = TIMESTAMP_INVALID;}
#ifdef NAN
#define TIMESTAMP_IS_INVALID(j) (isnan(j))
#else
#define TIMESTAMP_IS_INVALID(j) (j == TIMESTAMP_INVALID)
#endif
#define TIMESTAMP_NOBEGIN(j) {j = DT_NOBEGIN;}
#define TIMESTAMP_IS_NOBEGIN(j) (j == TIMESTAMP_NOBEGIN)
#define TIMESTAMP_NOEND(j) {j = TIMESTAMP_NOEND;}
#define TIMESTAMP_IS_NOEND(j) (j == TIMESTAMP_NOEND)
#define TIMESTAMP_CURRENT(j) {j = TIMESTAMP_CURRENT;}
#if defined(linux) && defined(__powerpc__)
extern int timestamp_is_current(double j);
#define TIMESTAMP_IS_CURRENT(j) timestamp_is_current(j)
#else
#define TIMESTAMP_IS_CURRENT(j) (j == TIMESTAMP_CURRENT)
#endif
#define TIMESTAMP_EPOCH(j) {j = TIMESTAMP_EPOCH;}
#if defined(linux) && defined(__powerpc__)
extern int timestamp_is_epoch(double j);
#define TIMESTAMP_IS_EPOCH(j) timestamp_is_epoch(j)
#else
#define TIMESTAMP_IS_EPOCH(j) (j == TIMESTAMP_EPOCH)
#endif
#define TIMESTAMP_IS_RELATIVE(j) (TIMESTAMP_IS_CURRENT(j) || TIMESTAMP_IS_EPOCH(j))
#define TIMESTAMP_NOT_FINITE(j) (TIMESTAMP_IS_INVALID(j) \
|| TIMESTAMP_IS_NOBEGIN(j) || TIMESTAMP_IS_NOEND(j))
#define TIMESTAMP_IS_RESERVED(j) (TIMESTAMP_IS_RELATIVE(j) || TIMESTAMP_NOT_FINITE(j))
#define TIMESPAN_INVALID(j) {(j).time = DT_INVALID;}
#ifdef NAN
#define TIMESPAN_IS_INVALID(j) (isnan((j).time))
#else
#define TIMESPAN_IS_INVALID(j) ((j).time == DATETIME_INVALID)
#endif
#define TIMESPAN_NOT_FINITE(j) TIMESPAN_IS_INVALID(j)
#define TIME_PREC_INV 1000000.0
#define JROUND(j) (rint(((double) (j))*TIME_PREC_INV)/TIME_PREC_INV)
#endif
/* TMODULO() /* TMODULO()
* Macro to replace modf(), which is broken on some platforms. * Macro to replace modf(), which is broken on some platforms.
*/ */
...@@ -325,63 +231,6 @@ extern int day_tab[2][13]; ...@@ -325,63 +231,6 @@ extern int day_tab[2][13];
|| ((m == UTIME_MAXMONTH) && (d <= UTIME_MAXDAY)))))) || ((m == UTIME_MAXMONTH) && (d <= UTIME_MAXDAY))))))
#if 0
/*
* datetime.c prototypes
*/
extern DateTime *datetime_in(char *str);
extern char *datetime_out(DateTime *dt);
extern bool datetime_eq(DateTime *dt1, DateTime *dt2);
extern bool datetime_ne(DateTime *dt1, DateTime *dt2);
extern bool datetime_lt(DateTime *dt1, DateTime *dt2);
extern bool datetime_le(DateTime *dt1, DateTime *dt2);
extern bool datetime_ge(DateTime *dt1, DateTime *dt2);
extern bool datetime_gt(DateTime *dt1, DateTime *dt2);
extern bool datetime_finite(DateTime *datetime);
extern int datetime_cmp(DateTime *dt1, DateTime *dt2);
extern DateTime *datetime_smaller(DateTime *dt1, DateTime *dt2);
extern DateTime *datetime_larger(DateTime *dt1, DateTime *dt2);
extern TimeSpan *timespan_in(char *str);
extern char *timespan_out(TimeSpan *span);
extern bool timespan_eq(TimeSpan *span1, TimeSpan *span2);
extern bool timespan_ne(TimeSpan *span1, TimeSpan *span2);
extern bool timespan_lt(TimeSpan *span1, TimeSpan *span2);
extern bool timespan_le(TimeSpan *span1, TimeSpan *span2);
extern bool timespan_ge(TimeSpan *span1, TimeSpan *span2);
extern bool timespan_gt(TimeSpan *span1, TimeSpan *span2);
extern bool timespan_finite(TimeSpan *span);
extern int timespan_cmp(TimeSpan *span1, TimeSpan *span2);
extern TimeSpan *timespan_smaller(TimeSpan *span1, TimeSpan *span2);
extern TimeSpan *timespan_larger(TimeSpan *span1, TimeSpan *span2);
extern text *datetime_text(DateTime *datetime);
extern DateTime *text_datetime(text *str);
extern text *timespan_text(TimeSpan *timespan);
extern TimeSpan *text_timespan(text *str);
extern DateTime *datetime_trunc(text *units, DateTime *datetime);
extern TimeSpan *timespan_trunc(text *units, TimeSpan *timespan);
extern float64 datetime_part(text *units, DateTime *datetime);
extern float64 timespan_part(text *units, TimeSpan *timespan);
extern text *datetime_zone(text *zone, DateTime *datetime);
extern TimeSpan *timespan_um(TimeSpan *span);
extern TimeSpan *timespan_pl(TimeSpan *span1, TimeSpan *span2);
extern TimeSpan *timespan_mi(TimeSpan *span1, TimeSpan *span2);
extern TimeSpan *timespan_div(TimeSpan *span1, float8 *arg2);
extern TimeSpan *datetime_mi(DateTime *dt1, DateTime *dt2);
extern DateTime *datetime_pl_span(DateTime *dt, TimeSpan *span);
extern DateTime *datetime_mi_span(DateTime *dt, TimeSpan *span);
extern TimeSpan *datetime_age(DateTime *dt1, DateTime *dt2);
#endif
extern void GetCurrentTime(struct tm * tm); extern void GetCurrentTime(struct tm * tm);
extern void j2date(int jd, int *year, int *month, int *day); extern void j2date(int jd, int *year, int *month, int *day);
extern int date2j(int year, int month, int day); extern int date2j(int year, int month, int day);
...@@ -393,15 +242,16 @@ extern int DecodeDateTime(char **field, int *ftype, ...@@ -393,15 +242,16 @@ extern int DecodeDateTime(char **field, int *ftype,
int nf, int *dtype, int nf, int *dtype,
struct tm * tm, double *fsec, int *tzp); struct tm * tm, double *fsec, int *tzp);
extern int DecodeTimeOnly(char **field, int *ftype, int nf, extern int DecodeTimeOnly(char **field, int *ftype,
int *dtype, struct tm * tm, double *fsec); int nf, int *dtype,
struct tm * tm, double *fsec, int *tzp);
extern int DecodeDateDelta(char **field, int *ftype, extern int DecodeDateDelta(char **field, int *ftype,
int nf, int *dtype, int nf, int *dtype,
struct tm * tm, double *fsec); struct tm * tm, double *fsec);
extern int EncodeDateOnly(struct tm * tm, int style, char *str); extern int EncodeDateOnly(struct tm * tm, int style, char *str);
extern int EncodeTimeOnly(struct tm * tm, double fsec, int style, char *str); extern int EncodeTimeOnly(struct tm * tm, double fsec, int *tzp, int style, char *str);
extern int EncodeDateTime(struct tm * tm, double fsec, int *tzp, char **tzn, int style, char *str); extern int EncodeDateTime(struct tm * tm, double fsec, int *tzp, char **tzn, int style, char *str);
extern int EncodeTimeSpan(struct tm * tm, double fsec, int style, char *str); extern int EncodeTimeSpan(struct tm * tm, double fsec, int style, char *str);
...@@ -421,18 +271,4 @@ extern datetkn *datebsearch(char *key, datetkn *base, unsigned int nel); ...@@ -421,18 +271,4 @@ extern datetkn *datebsearch(char *key, datetkn *base, unsigned int nel);
extern int j2day(int jd); extern int j2day(int jd);
#if 0
static int EncodeSpecialTimestamp(Timestamp dt, char *str);
static Timestamp dt2local(Timestamp dt, int timezone);
static void dt2time(Timestamp dt, int *hour, int *min, double *sec);
static int timespan2tm(TimeSpan span, struct tm * tm, float8 *fsec);
static int tm2timespan(struct tm * tm, double fsec, TimeSpan *span);
#endif
#endif /* DATETIME_H */ #endif /* DATETIME_H */
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: geo_decls.h,v 1.25 2000/02/17 03:39:51 tgl Exp $ * $Id: geo_decls.h,v 1.26 2000/03/14 23:06:50 thomas Exp $
* *
* NOTE * NOTE
* These routines do *not* use the float types from adt/. * These routines do *not* use the float types from adt/.
...@@ -284,8 +284,6 @@ extern PATH *path_add_pt(PATH *path, Point *point); ...@@ -284,8 +284,6 @@ extern PATH *path_add_pt(PATH *path, Point *point);
extern PATH *path_sub_pt(PATH *path, Point *point); extern PATH *path_sub_pt(PATH *path, Point *point);
extern PATH *path_mul_pt(PATH *path, Point *point); extern PATH *path_mul_pt(PATH *path, Point *point);
extern PATH *path_div_pt(PATH *path, Point *point); extern PATH *path_div_pt(PATH *path, Point *point);
extern bool path_contain_pt(PATH *path, Point *p);
extern bool pt_contained_path(Point *p, PATH *path);
extern Point *path_center(PATH *path); extern Point *path_center(PATH *path);
extern POLYGON *path_poly(PATH *path); extern POLYGON *path_poly(PATH *path);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: int8.h,v 1.18 2000/02/21 03:36:59 tgl Exp $ * $Id: int8.h,v 1.19 2000/03/14 23:06:50 thomas Exp $
* *
* NOTES * NOTES
* These data types are supported on all 64-bit architectures, and may * These data types are supported on all 64-bit architectures, and may
...@@ -76,6 +76,9 @@ extern int64 *int8pl(int64 *val1, int64 *val2); ...@@ -76,6 +76,9 @@ extern int64 *int8pl(int64 *val1, int64 *val2);
extern int64 *int8mi(int64 *val1, int64 *val2); extern int64 *int8mi(int64 *val1, int64 *val2);
extern int64 *int8mul(int64 *val1, int64 *val2); extern int64 *int8mul(int64 *val1, int64 *val2);
extern int64 *int8div(int64 *val1, int64 *val2); extern int64 *int8div(int64 *val1, int64 *val2);
extern int64 *int8abs(int64 *val1);
extern int64 *int8fac(int64 *val1);
extern int64 *int8mod(int64 *val1, int64 *val2);
extern int64 *int8larger(int64 *val1, int64 *val2); extern int64 *int8larger(int64 *val1, int64 *val2);
extern int64 *int8smaller(int64 *val1, int64 *val2); extern int64 *int8smaller(int64 *val1, int64 *val2);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: timestamp.h,v 1.1 2000/02/16 17:26:26 thomas Exp $ * $Id: timestamp.h,v 1.2 2000/03/14 23:06:51 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -31,10 +31,8 @@ typedef double Timestamp; ...@@ -31,10 +31,8 @@ typedef double Timestamp;
typedef struct typedef struct
{ {
double time; /* all time units other than months and double time; /* all time units other than months and years */
* years */ int4 month; /* months and years, after time for alignment */
int4 month; /* months and years, after time for
* alignment */
} Interval; } Interval;
...@@ -101,49 +99,6 @@ extern int timestamp_is_epoch(double j); ...@@ -101,49 +99,6 @@ extern int timestamp_is_epoch(double j);
#define JROUND(j) (rint(((double) (j))*TIME_PREC_INV)/TIME_PREC_INV) #define JROUND(j) (rint(((double) (j))*TIME_PREC_INV)/TIME_PREC_INV)
#if 0
/*
* Date/time validation
* Include check for leap year.
*/
extern int day_tab[2][13];
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
/* Julian date support for date2j() and j2date()
* Set the minimum year to one greater than the year of the first valid day
* to avoid having to check year and day both. - tgl 97/05/08
*/
#define JULIAN_MINYEAR (-4713)
#define JULIAN_MINMONTH (11)
#define JULIAN_MINDAY (23)
#define IS_VALID_JULIAN(y,m,d) ((y > JULIAN_MINYEAR) \
|| ((y == JULIAN_MINYEAR) && ((m > JULIAN_MINMONTH) \
|| ((m == JULIAN_MINMONTH) && (d >= JULIAN_MINDAY)))))
#define UTIME_MINYEAR (1901)
#define UTIME_MINMONTH (12)
#define UTIME_MINDAY (14)
#define UTIME_MAXYEAR (2038)
#define UTIME_MAXMONTH (01)
#define UTIME_MAXDAY (18)
#define IS_VALID_UTIME(y,m,d) (((y > UTIME_MINYEAR) \
|| ((y == UTIME_MINYEAR) && ((m > UTIME_MINMONTH) \
|| ((m == UTIME_MINMONTH) && (d >= UTIME_MINDAY))))) \
&& ((y < UTIME_MAXYEAR) \
|| ((y == UTIME_MAXYEAR) && ((m < UTIME_MAXMONTH) \
|| ((m == UTIME_MAXMONTH) && (d <= UTIME_MAXDAY))))))
#endif
/* /*
* timestamp.c prototypes * timestamp.c prototypes
*/ */
...@@ -193,6 +148,7 @@ extern Interval *timestamp_mi(Timestamp *dt1, Timestamp *dt2); ...@@ -193,6 +148,7 @@ extern Interval *timestamp_mi(Timestamp *dt1, Timestamp *dt2);
extern Timestamp *timestamp_pl_span(Timestamp *dt, Interval *span); extern Timestamp *timestamp_pl_span(Timestamp *dt, Interval *span);
extern Timestamp *timestamp_mi_span(Timestamp *dt, Interval *span); extern Timestamp *timestamp_mi_span(Timestamp *dt, Interval *span);
extern Interval *timestamp_age(Timestamp *dt1, Timestamp *dt2); extern Interval *timestamp_age(Timestamp *dt1, Timestamp *dt2);
extern bool overlaps_timestamp(Timestamp *dt1, Timestamp *dt2, Timestamp *dt3, Timestamp *dt4);
extern int tm2timestamp(struct tm * tm, double fsec, int *tzp, Timestamp *dt); extern int tm2timestamp(struct tm * tm, double fsec, int *tzp, Timestamp *dt);
extern int timestamp2tm(Timestamp dt, int *tzp, struct tm * tm, double *fsec, char **tzn); extern int timestamp2tm(Timestamp dt, int *tzp, struct tm * tm, double *fsec, char **tzn);
......
...@@ -291,5 +291,7 @@ DELETE FROM tmp3 where a=5; ...@@ -291,5 +291,7 @@ DELETE FROM tmp3 where a=5;
-- Try (and succeed) -- Try (and succeed)
ALTER TABLE tmp3 add constraint tmpconstr foreign key (a) references tmp2 match full; ALTER TABLE tmp3 add constraint tmpconstr foreign key (a) references tmp2 match full;
NOTICE: ALTER TABLE ... ADD CONSTRAINT will create implicit trigger(s) for FOREIGN KEY check(s) NOTICE: ALTER TABLE ... ADD CONSTRAINT will create implicit trigger(s) for FOREIGN KEY check(s)
DROP TABLE tmp3 DROP TABLE tmp3;
DROP TABLE tmp2 NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "tmp2"
NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "tmp2"
DROP TABLE tmp2;
...@@ -36,7 +36,7 @@ SELECT '' AS four, BOX_TBL.*; ...@@ -36,7 +36,7 @@ SELECT '' AS four, BOX_TBL.*;
| (3,3),(3,3) | (3,3),(3,3)
(4 rows) (4 rows)
SELECT '' AS four, b.*, box_area(b.f1) as barea SELECT '' AS four, b.*, area(b.f1) as barea
FROM BOX_TBL b; FROM BOX_TBL b;
four | f1 | barea four | f1 | barea
------+---------------------+------- ------+---------------------+-------
......
...@@ -40,7 +40,7 @@ ERROR: Attribute 'foobar' not found ...@@ -40,7 +40,7 @@ ERROR: Attribute 'foobar' not found
-- missing relation name (this had better not wildcard!) -- missing relation name (this had better not wildcard!)
delete from; delete from;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- no such relation -- no such relation
delete from nonesuch; delete from nonesuch;
ERROR: Relation 'nonesuch' does not exist ERROR: Relation 'nonesuch' does not exist
...@@ -49,7 +49,7 @@ ERROR: Relation 'nonesuch' does not exist ...@@ -49,7 +49,7 @@ ERROR: Relation 'nonesuch' does not exist
-- missing relation name (this had better not wildcard!) -- missing relation name (this had better not wildcard!)
drop table; drop table;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- no such relation -- no such relation
drop table nonesuch; drop table nonesuch;
ERROR: Relation 'nonesuch' does not exist ERROR: Relation 'nonesuch' does not exist
...@@ -59,7 +59,7 @@ ERROR: Relation 'nonesuch' does not exist ...@@ -59,7 +59,7 @@ ERROR: Relation 'nonesuch' does not exist
-- relation renaming -- relation renaming
-- missing relation name -- missing relation name
alter table rename; alter table rename;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- no such relation -- no such relation
alter table nonesuch rename to newnonesuch; alter table nonesuch rename to newnonesuch;
ERROR: Relation 'nonesuch' does not exist ERROR: Relation 'nonesuch' does not exist
...@@ -144,7 +144,7 @@ ERROR: AggregateCreate: transition function 2 MUST have an initial value ...@@ -144,7 +144,7 @@ ERROR: AggregateCreate: transition function 2 MUST have an initial value
-- missing index name -- missing index name
drop index; drop index;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- bad index name -- bad index name
drop index 314159; drop index 314159;
ERROR: parser: parse error at or near "314159" ERROR: parser: parse error at or near "314159"
...@@ -156,16 +156,16 @@ ERROR: index "nonesuch" nonexistent ...@@ -156,16 +156,16 @@ ERROR: index "nonesuch" nonexistent
-- missing aggregate name -- missing aggregate name
drop aggregate; drop aggregate;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- bad aggregate name -- bad aggregate name
drop aggregate 314159; drop aggregate 314159;
ERROR: parser: parse error at or near "314159" ERROR: parser: parse error at or near "314159"
-- no such aggregate -- no such aggregate
drop aggregate nonesuch; drop aggregate nonesuch;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- missing aggregate type -- missing aggregate type
drop aggregate newcnt1; drop aggregate newcnt1;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- bad aggregate type -- bad aggregate type
drop aggregate newcnt nonesuch; drop aggregate newcnt nonesuch;
ERROR: RemoveAggregate: type 'nonesuch' does not exist ERROR: RemoveAggregate: type 'nonesuch' does not exist
...@@ -189,7 +189,7 @@ ERROR: RemoveFunction: function 'nonesuch()' does not exist ...@@ -189,7 +189,7 @@ ERROR: RemoveFunction: function 'nonesuch()' does not exist
-- missing type name -- missing type name
drop type; drop type;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- bad type name -- bad type name
drop type 314159; drop type 314159;
ERROR: parser: parse error at or near "314159" ERROR: parser: parse error at or near "314159"
...@@ -201,13 +201,13 @@ ERROR: RemoveType: type 'nonesuch' does not exist ...@@ -201,13 +201,13 @@ ERROR: RemoveType: type 'nonesuch' does not exist
-- missing everything -- missing everything
drop operator; drop operator;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- bad operator name -- bad operator name
drop operator equals; drop operator equals;
ERROR: parser: parse error at or near "equals" ERROR: parser: parse error at or near "equals"
-- missing type list -- missing type list
drop operator ===; drop operator ===;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- missing parentheses -- missing parentheses
drop operator int4, int4; drop operator int4, int4;
ERROR: parser: parse error at or near "int4" ERROR: parser: parse error at or near "int4"
...@@ -243,7 +243,7 @@ ERROR: parser: parse error at or near ")" ...@@ -243,7 +243,7 @@ ERROR: parser: parse error at or near ")"
-- missing rule name -- missing rule name
drop rule; drop rule;
ERROR: parser: parse error at or near "" ERROR: parser: parse error at or near ";"
-- bad rule name -- bad rule name
drop rule 314159; drop rule 314159;
ERROR: parser: parse error at or near "314159" ERROR: parser: parse error at or near "314159"
......
...@@ -149,7 +149,19 @@ SELECT '' AS five, f.f1, f.f1 % AS round_f1 ...@@ -149,7 +149,19 @@ SELECT '' AS five, f.f1, f.f1 % AS round_f1
| 1.2345678901234e-200 | 0 | 1.2345678901234e-200 | 0
(5 rows) (5 rows)
SELECT sqrt(float8 '64') AS eight;
eight
-------
8
(1 row)
-- square root -- square root
SELECT |/ float8 '64' AS eight;
eight
-------
8
(1 row)
SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
FROM FLOAT8_TBL f FROM FLOAT8_TBL f
WHERE f.f1 > '0.0'; WHERE f.f1 > '0.0';
...@@ -172,6 +184,12 @@ SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1 ...@@ -172,6 +184,12 @@ SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1
(3 rows) (3 rows)
-- cube root -- cube root
SELECT ||/ float8 '27' AS three;
three
-------
3
(1 row)
SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f; SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
five | f1 | cbrt_f1 five | f1 | cbrt_f1
------+----------------------+---------------------- ------+----------------------+----------------------
...@@ -217,7 +235,7 @@ SELECT '' AS five, FLOAT8_TBL.*; ...@@ -217,7 +235,7 @@ SELECT '' AS five, FLOAT8_TBL.*;
| -1.2345678901234e-200 | -1.2345678901234e-200
(5 rows) (5 rows)
-- test for over and under flow -- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
ERROR: Input '10e400' is out of range for float8 ERROR: Input '10e400' is out of range for float8
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
......
...@@ -150,11 +150,11 @@ SELECT '' as six, box(f1) AS box FROM CIRCLE_TBL; ...@@ -150,11 +150,11 @@ SELECT '' as six, box(f1) AS box FROM CIRCLE_TBL;
six | box six | box
-----+---------------------------------------------------------------------------- -----+----------------------------------------------------------------------------
| (2.12132034355964,2.12132034355964),(-2.12132034355964,-2.12132034355964) | (2.12132034355964,2.12132034355964),(-2.12132034355964,-2.12132034355964)
| (71.7106781186547,72.7106781186547),(-69.7106781186547,-68.7106781186547) | (71.7106781186548,72.7106781186548),(-69.7106781186548,-68.7106781186548)
| (4.53553390593274,6.53553390593274),(-2.53553390593274,-0.535533905932737) | (4.53553390593274,6.53553390593274),(-2.53553390593274,-0.535533905932738)
| (3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559642) | (3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559642)
| (107.071067811865,207.071067811865),(92.9289321881345,192.928932188135) | (107.071067811865,207.071067811865),(92.9289321881345,192.928932188135)
| (170.710678118655,70.7106781186547),(29.2893218813453,-70.7106781186547) | (170.710678118655,70.7106781186548),(29.2893218813452,-70.7106781186548)
(6 rows) (6 rows)
-- translation -- translation
...@@ -280,7 +280,7 @@ SELECT '' AS twenty, b.f1 / p.f1 AS rotation ...@@ -280,7 +280,7 @@ SELECT '' AS twenty, b.f1 / p.f1 AS rotation
-- Paths -- Paths
-- --
SET geqo TO 'off'; SET geqo TO 'off';
SELECT '' AS eight, points(f1) AS npoints, f1 AS path FROM PATH_TBL; SELECT '' AS eight, npoints(f1) AS npoints, f1 AS path FROM PATH_TBL;
eight | npoints | path eight | npoints | path
-------+---------+--------------------------- -------+---------+---------------------------
| 2 | [(1,2),(3,4)] | 2 | [(1,2),(3,4)]
...@@ -397,7 +397,7 @@ SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained ...@@ -397,7 +397,7 @@ SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
| (10,10) | ((0,1),(0,1)) | f | (10,10) | ((0,1),(0,1)) | f
(24 rows) (24 rows)
SELECT '' AS four, points(f1) AS npoints, f1 AS polygon SELECT '' AS four, npoints(f1) AS npoints, f1 AS polygon
FROM POLYGON_TBL; FROM POLYGON_TBL;
four | npoints | polygon four | npoints | polygon
------+---------+--------------------- ------+---------+---------------------
...@@ -503,11 +503,11 @@ SELECT '' AS twentyfour, c1.f1 AS circle, p1.f1 AS point, (p1.f1 <-> c1.f1) AS d ...@@ -503,11 +503,11 @@ SELECT '' AS twentyfour, c1.f1 AS circle, p1.f1 AS point, (p1.f1 <-> c1.f1) AS d
WHERE (p1.f1 <-> c1.f1) > 0 WHERE (p1.f1 <-> c1.f1) > 0
ORDER BY distance, circle, point using <<; ORDER BY distance, circle, point using <<;
twentyfour | circle | point | distance twentyfour | circle | point | distance
------------+----------------+------------+------------------ ------------+----------------+------------+-------------------
| <(100,0),100> | (5.1,34.5) | 0.97653192697797 | <(100,0),100> | (5.1,34.5) | 0.976531926977965
| <(1,2),3> | (-3,4) | 1.47213595499958 | <(1,2),3> | (-3,4) | 1.47213595499958
| <(0,0),3> | (-3,4) | 2 | <(0,0),3> | (-3,4) | 2
| <(100,0),100> | (-3,4) | 3.07764064044152 | <(100,0),100> | (-3,4) | 3.07764064044151
| <(100,0),100> | (-5,-12) | 5.68348972285122 | <(100,0),100> | (-5,-12) | 5.68348972285122
| <(1,3),5> | (-10,0) | 6.40175425099138 | <(1,3),5> | (-10,0) | 6.40175425099138
| <(1,3),5> | (10,10) | 6.40175425099138 | <(1,3),5> | (10,10) | 6.40175425099138
......
...@@ -295,21 +295,3 @@ SELECT (2 + 2) / 2 AS two; ...@@ -295,21 +295,3 @@ SELECT (2 + 2) / 2 AS two;
2 2
(1 row) (1 row)
SELECT dsqrt(float8 '64') AS eight;
eight
-------
8
(1 row)
SELECT |/float8 '64' AS eight;
eight
-------
8
(1 row)
SELECT ||/float8 '27' AS three;
three
-------
3
(1 row)
...@@ -646,10 +646,10 @@ SELECT t1.id1, t1.result, t2.expected ...@@ -646,10 +646,10 @@ SELECT t1.id1, t1.result, t2.expected
(0 rows) (0 rows)
-- ****************************** -- ******************************
-- * POWER(10, LN(value)) check -- * POW(10, LN(value)) check
-- ****************************** -- ******************************
DELETE FROM num_result; DELETE FROM num_result;
INSERT INTO num_result SELECT id, 0, POWER(numeric '10', LN(ABS(round(val,200)))) INSERT INTO num_result SELECT id, 0, POW(numeric '10', LN(ABS(round(val,200))))
FROM num_data FROM num_data
WHERE val != '0.0'; WHERE val != '0.0';
SELECT t1.id1, t1.result, t2.expected SELECT t1.id1, t1.result, t2.expected
......
...@@ -1148,26 +1148,26 @@ SELECT * FROM shoelace ORDER BY sl_name; ...@@ -1148,26 +1148,26 @@ SELECT * FROM shoelace ORDER BY sl_name;
-- --
SELECT viewname, definition FROM pg_views ORDER BY viewname; SELECT viewname, definition FROM pg_views ORDER BY viewname;
viewname | definition viewname | definition
--------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
iexit | SELECT ih.name, ih.thepath, interpt_pp(ih.thepath, r.thepath) AS exit FROM ihighway ih (name, thepath), ramp r (name, thepath) WHERE (ih.thepath ## r.thepath); iexit | SELECT ih.name, ih.thepath, interpt_pp(ih.thepath, r.thepath) AS exit FROM ihighway ih, ramp r WHERE (ih.thepath ## r.thepath);
pg_indexes | SELECT c.relname AS tablename, i.relname AS indexname, pg_get_indexdef(x.indexrelid) AS indexdef FROM pg_index x (indexrelid, indrelid, indproc, indkey, indclass, indisclustered, indislossy, indhaskeytype, indisunique, indisprimary, indreference, indpred), pg_class c (relname, reltype, relowner, relam, relpages, reltuples, rellongrelid, relhasindex, relisshared, relkind, relnatts, relchecks, reltriggers, relukeys, relfkeys, relrefs, relhaspkey, relhasrules, relacl), pg_class i (relname, reltype, relowner, relam, relpages, reltuples, rellongrelid, relhasindex, relisshared, relkind, relnatts, relchecks, reltriggers, relukeys, relfkeys, relrefs, relhaspkey, relhasrules, relacl) WHERE ((c.oid = x.indrelid) AND (i.oid = x.indexrelid)); pg_indexes | SELECT c.relname AS tablename, i.relname AS indexname, pg_get_indexdef(x.indexrelid) AS indexdef FROM pg_index x, pg_class c, pg_class i WHERE ((c.oid = x.indrelid) AND (i.oid = x.indexrelid));
pg_rules | SELECT c.relname AS tablename, r.rulename, pg_get_ruledef(r.rulename) AS definition FROM pg_rewrite r (rulename, ev_type, ev_class, ev_attr, is_instead, ev_qual, ev_action), pg_class c (relname, reltype, relowner, relam, relpages, reltuples, rellongrelid, relhasindex, relisshared, relkind, relnatts, relchecks, reltriggers, relukeys, relfkeys, relrefs, relhaspkey, relhasrules, relacl) WHERE ((r.rulename !~ '^_RET'::text) AND (c.oid = r.ev_class)); pg_rules | SELECT c.relname AS tablename, r.rulename, pg_get_ruledef(r.rulename) AS definition FROM pg_rewrite r, pg_class c WHERE ((r.rulename !~ '^_RET'::text) AND (c.oid = r.ev_class));
pg_tables | SELECT c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, c.relhasindex AS hasindexes, c.relhasrules AS hasrules, (c.reltriggers > 0) AS hastriggers FROM pg_class c (relname, reltype, relowner, relam, relpages, reltuples, rellongrelid, relhasindex, relisshared, relkind, relnatts, relchecks, reltriggers, relukeys, relfkeys, relrefs, relhaspkey, relhasrules, relacl) WHERE (((c.relkind = 'r'::"char") OR (c.relkind = 's'::"char")) AND (NOT (EXISTS (SELECT pg_rewrite.rulename FROM pg_rewrite WHERE ((pg_rewrite.ev_class = c.oid) AND (pg_rewrite.ev_type = '1'::"char")))))); pg_tables | SELECT c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, c.relhasindex AS hasindexes, c.relhasrules AS hasrules, (c.reltriggers > 0) AS hastriggers FROM pg_class c WHERE (((c.relkind = 'r'::"char") OR (c.relkind = 's'::"char")) AND (NOT (EXISTS (SELECT pg_rewrite.rulename FROM pg_rewrite WHERE ((pg_rewrite.ev_class = c.oid) AND (pg_rewrite.ev_type = '1'::"char"))))));
pg_user | SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usetrace, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil FROM pg_shadow; pg_user | SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usetrace, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil FROM pg_shadow;
pg_views | SELECT c.relname AS viewname, pg_get_userbyid(c.relowner) AS viewowner, pg_get_viewdef(c.relname) AS definition FROM pg_class c (relname, reltype, relowner, relam, relpages, reltuples, rellongrelid, relhasindex, relisshared, relkind, relnatts, relchecks, reltriggers, relukeys, relfkeys, relrefs, relhaspkey, relhasrules, relacl) WHERE (c.relhasrules AND (EXISTS (SELECT r.rulename FROM pg_rewrite r (rulename, ev_type, ev_class, ev_attr, is_instead, ev_qual, ev_action) WHERE ((r.ev_class = c.oid) AND (r.ev_type = '1'::"char"))))); pg_views | SELECT c.relname AS viewname, pg_get_userbyid(c.relowner) AS viewowner, pg_get_viewdef(c.relname) AS definition FROM pg_class c WHERE (c.relhasrules AND (EXISTS (SELECT r.rulename FROM pg_rewrite r WHERE ((r.ev_class = c.oid) AND (r.ev_type = '1'::"char")))));
rtest_v1 | SELECT rtest_t1.a, rtest_t1.b FROM rtest_t1; rtest_v1 | SELECT rtest_t1.a, rtest_t1.b FROM rtest_t1;
rtest_vcomp | SELECT x.part, (x.size * y.factor) AS size_in_cm FROM rtest_comp x (part, unit, size), rtest_unitfact y (unit, factor) WHERE (x.unit = y.unit); rtest_vcomp | SELECT x.part, (x.size * y.factor) AS size_in_cm FROM rtest_comp x, rtest_unitfact y WHERE (x.unit = y.unit);
rtest_vview1 | SELECT x.a, x.b FROM rtest_view1 x (a, b, v) WHERE (0 < (SELECT count(*) AS count FROM rtest_view2 y (a) WHERE (y.a = x.a))); rtest_vview1 | SELECT x.a, x.b FROM rtest_view1 x WHERE (0 < (SELECT count(*) AS count FROM rtest_view2 y WHERE (y.a = x.a)));
rtest_vview2 | SELECT rtest_view1.a, rtest_view1.b FROM rtest_view1 WHERE rtest_view1.v; rtest_vview2 | SELECT rtest_view1.a, rtest_view1.b FROM rtest_view1 WHERE rtest_view1.v;
rtest_vview3 | SELECT x.a, x.b FROM rtest_vview2 x (a, b) WHERE (0 < (SELECT count(*) AS count FROM rtest_view2 y (a) WHERE (y.a = x.a))); rtest_vview3 | SELECT x.a, x.b FROM rtest_vview2 x WHERE (0 < (SELECT count(*) AS count FROM rtest_view2 y WHERE (y.a = x.a)));
rtest_vview4 | SELECT x.a, x.b, count(y.a) AS refcount FROM rtest_view1 x (a, b, v), rtest_view2 y (a) WHERE (x.a = y.a) GROUP BY x.a, x.b; rtest_vview4 | SELECT x.a, x.b, count(y.a) AS refcount FROM rtest_view1 x, rtest_view2 y WHERE (x.a = y.a) GROUP BY x.a, x.b;
rtest_vview5 | SELECT rtest_view1.a, rtest_view1.b, rtest_viewfunc1(rtest_view1.a) AS refcount FROM rtest_view1; rtest_vview5 | SELECT rtest_view1.a, rtest_view1.b, rtest_viewfunc1(rtest_view1.a) AS refcount FROM rtest_view1;
shoe | SELECT sh.shoename, sh.sh_avail, sh.slcolor, sh.slminlen, (sh.slminlen * un.un_fact) AS slminlen_cm, sh.slmaxlen, (sh.slmaxlen * un.un_fact) AS slmaxlen_cm, sh.slunit FROM shoe_data sh (shoename, sh_avail, slcolor, slminlen, slmaxlen, slunit), unit un (un_name, un_fact) WHERE (sh.slunit = un.un_name); shoe | SELECT sh.shoename, sh.sh_avail, sh.slcolor, sh.slminlen, (sh.slminlen * un.un_fact) AS slminlen_cm, sh.slmaxlen, (sh.slmaxlen * un.un_fact) AS slmaxlen_cm, sh.slunit FROM shoe_data sh, unit un WHERE (sh.slunit = un.un_name);
shoe_ready | SELECT rsh.shoename, rsh.sh_avail, rsl.sl_name, rsl.sl_avail, int4smaller(rsh.sh_avail, rsl.sl_avail) AS total_avail FROM shoe rsh (shoename, sh_avail, slcolor, slminlen, slminlen_cm, slmaxlen, slmaxlen_cm, slunit), shoelace rsl (sl_name, sl_avail, sl_color, sl_len, sl_unit, sl_len_cm) WHERE (((rsl.sl_color = rsh.slcolor) AND (rsl.sl_len_cm >= rsh.slminlen_cm)) AND (rsl.sl_len_cm <= rsh.slmaxlen_cm)); shoe_ready | SELECT rsh.shoename, rsh.sh_avail, rsl.sl_name, rsl.sl_avail, int4smaller(rsh.sh_avail, rsl.sl_avail) AS total_avail FROM shoe rsh, shoelace rsl WHERE (((rsl.sl_color = rsh.slcolor) AND (rsl.sl_len_cm >= rsh.slminlen_cm)) AND (rsl.sl_len_cm <= rsh.slmaxlen_cm));
shoelace | SELECT s.sl_name, s.sl_avail, s.sl_color, s.sl_len, s.sl_unit, (s.sl_len * u.un_fact) AS sl_len_cm FROM shoelace_data s (sl_name, sl_avail, sl_color, sl_len, sl_unit), unit u (un_name, un_fact) WHERE (s.sl_unit = u.un_name); shoelace | SELECT s.sl_name, s.sl_avail, s.sl_color, s.sl_len, s.sl_unit, (s.sl_len * u.un_fact) AS sl_len_cm FROM shoelace_data s, unit u WHERE (s.sl_unit = u.un_name);
shoelace_candelete | SELECT shoelace_obsolete.sl_name, shoelace_obsolete.sl_avail, shoelace_obsolete.sl_color, shoelace_obsolete.sl_len, shoelace_obsolete.sl_unit, shoelace_obsolete.sl_len_cm FROM shoelace_obsolete WHERE (shoelace_obsolete.sl_avail = 0); shoelace_candelete | SELECT shoelace_obsolete.sl_name, shoelace_obsolete.sl_avail, shoelace_obsolete.sl_color, shoelace_obsolete.sl_len, shoelace_obsolete.sl_unit, shoelace_obsolete.sl_len_cm FROM shoelace_obsolete WHERE (shoelace_obsolete.sl_avail = 0);
shoelace_obsolete | SELECT shoelace.sl_name, shoelace.sl_avail, shoelace.sl_color, shoelace.sl_len, shoelace.sl_unit, shoelace.sl_len_cm FROM shoelace WHERE (NOT (EXISTS (SELECT shoe.shoename FROM shoe WHERE (shoe.slcolor = shoelace.sl_color)))); shoelace_obsolete | SELECT shoelace.sl_name, shoelace.sl_avail, shoelace.sl_color, shoelace.sl_len, shoelace.sl_unit, shoelace.sl_len_cm FROM shoelace WHERE (NOT (EXISTS (SELECT shoe.shoename FROM shoe WHERE (shoe.slcolor = shoelace.sl_color))));
street | SELECT r.name, r.thepath, c.cname FROM road r (name, thepath), real_city c (pop, cname, outline) WHERE (c.outline ## r.thepath); street | SELECT r.name, r.thepath, c.cname FROM road r, real_city c WHERE (c.outline ## r.thepath);
toyemp | SELECT emp.name, emp.age, emp."location", (12 * emp.salary) AS annualsal FROM emp; toyemp | SELECT emp.name, emp.age, emp."location", (12 * emp.salary) AS annualsal FROM emp;
(20 rows) (20 rows)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
-- --
-- Shorthand values -- Shorthand values
-- Not directly usable for regression testing since these are not constants. -- Not directly usable for regression testing since these are not constants.
-- So, just try to test parser and hope for the best - tgl 97/04/26 -- So, just try to test parser and hope for the best - thomas 97/04/26
SELECT (timestamp 'today' = (timestamp 'yesterday' + interval '1 day')) as "True"; SELECT (timestamp 'today' = (timestamp 'yesterday' + interval '1 day')) as "True";
True True
------ ------
...@@ -34,13 +34,25 @@ SELECT (timestamp 'now' - 'current') AS "ZeroSecs"; ...@@ -34,13 +34,25 @@ SELECT (timestamp 'now' - 'current') AS "ZeroSecs";
@ 0 @ 0
(1 row) (1 row)
SET DateStyle = 'Postgres,noneuropean'; SET DateStyle = 'Postgres,NonEuropean';
SELECT timestamp('1994-01-01', '11:00') AS "Jan_01_1994_11am"; SELECT timestamp(date '1994-01-01', time '11:00') AS "Jan_01_1994_11am";
Jan_01_1994_11am Jan_01_1994_11am
------------------------------ ------------------------------
Sat Jan 01 11:00:00 1994 PST Sat Jan 01 11:00:00 1994 PST
(1 row) (1 row)
SELECT timestamp(date '1994-01-01', time '10:00') AS "Jan_01_1994_10am";
Jan_01_1994_10am
------------------------------
Sat Jan 01 10:00:00 1994 PST
(1 row)
SELECT timestamp(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
Jan_01_1994_8am
------------------------------
Sat Jan 01 08:00:00 1994 PST
(1 row)
CREATE TABLE TIMESTAMP_TBL ( d1 timestamp); CREATE TABLE TIMESTAMP_TBL ( d1 timestamp);
INSERT INTO TIMESTAMP_TBL VALUES ('current'); INSERT INTO TIMESTAMP_TBL VALUES ('current');
INSERT INTO TIMESTAMP_TBL VALUES ('today'); INSERT INTO TIMESTAMP_TBL VALUES ('today');
......
#!/bin/sh #!/bin/sh
# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.43 2000/03/01 21:10:04 petere Exp $ # $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.44 2000/03/14 23:06:55 thomas Exp $
# #
if [ $# -eq 0 ] if [ $# -eq 0 ]; then
then
echo "Syntax: $0 <hostname> [extra-tests]" echo "Syntax: $0 <hostname> [extra-tests]"
exit 1 exit 1
fi fi
...@@ -11,8 +10,7 @@ hostname=$1 ...@@ -11,8 +10,7 @@ hostname=$1
shift shift
extratests="$*" extratests="$*"
if [ "x$hostname" = "xwin" -o "x$hostname" = "xi386-pc-qnx4" ] if [ "x$hostname" = "xwin" -o "x$hostname" = "xi386-pc-qnx4" ]; then
then
HOSTLOC="-h localhost" HOSTLOC="-h localhost"
else else
HOSTLOC="" HOSTLOC=""
...@@ -81,21 +79,22 @@ if [ $? -ne 0 ]; then ...@@ -81,21 +79,22 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
if [ "x$hostname" != "xi386-pc-qnx4" ] if [ "x$hostname" != "xi386-pc-qnx4" ]; then
then echo "=============== installing languages... ================="
echo "=============== installing PL/pgSQL... =================" $ECHO_N "installing PL/pgSQL .. " $ECHO_C
createlang $HOSTLOC plpgsql regression createlang $HOSTLOC plpgsql regression
if [ $? -ne 0 -a $? -ne 2 ]; then if [ $? -ne 0 -a $? -ne 2 ]; then
echo createlang failed echo failed
exit 1 exit 1
else
echo ok
fi fi
fi fi
echo "=============== running regression queries... =================" echo "=============== running regression queries... ================="
echo "" > regression.diffs echo "" > regression.diffs
if [ "x$hostname" = "xi386-pc-qnx4" ] if [ "x$hostname" = "xi386-pc-qnx4" ]; then
then
DIFFOPT="-b" DIFFOPT="-b"
else else
DIFFOPT="-w" DIFFOPT="-w"
...@@ -126,8 +125,7 @@ do ...@@ -126,8 +125,7 @@ do
fi fi
done done
if [ `diff ${DIFFOPT} ${EXPECTED} results/${tst}.out | wc -l` -ne 0 ] if [ `diff ${DIFFOPT} ${EXPECTED} results/${tst}.out | wc -l` -ne 0 ]; then
then
( diff ${DIFFOPT} -C3 ${EXPECTED} results/${tst}.out; \ ( diff ${DIFFOPT} -C3 ${EXPECTED} results/${tst}.out; \
echo ""; \ echo ""; \
echo "----------------------"; \ echo "----------------------"; \
...@@ -147,24 +145,23 @@ $FRONTEND regression < errors.sql ...@@ -147,24 +145,23 @@ $FRONTEND regression < errors.sql
#set this to 1 to avoid clearing the database #set this to 1 to avoid clearing the database
debug=0 debug=0
if test "$debug" -eq 1 if [ test "$debug" -eq 1 ]; then
then echo Skipping clearing and deletion of the regression database
echo Skipping clearing and deletion of the regression database
else else
echo "=============== clearing regression database... =================" echo "=============== clearing regression database... ================="
$FRONTEND regression < drop.sql $FRONTEND regression < drop.sql
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo the drop script has an error echo the drop script has an error
exit 1 exit 1
fi fi
exit 0 exit 0
echo "=============== dropping regression database... =================" echo "=============== dropping regression database... ================="
dropdb regression dropdb regression
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo dropdb failed echo dropdb failed
exit 1 exit 1
fi fi
exit 0 exit 0
fi fi
...@@ -189,7 +189,7 @@ DELETE FROM tmp3 where a=5; ...@@ -189,7 +189,7 @@ DELETE FROM tmp3 where a=5;
-- Try (and succeed) -- Try (and succeed)
ALTER TABLE tmp3 add constraint tmpconstr foreign key (a) references tmp2 match full; ALTER TABLE tmp3 add constraint tmpconstr foreign key (a) references tmp2 match full;
DROP TABLE tmp3 DROP TABLE tmp3;
DROP TABLE tmp2 DROP TABLE tmp2;
...@@ -39,7 +39,7 @@ INSERT INTO BOX_TBL (f1) VALUES ('asdfasdf(ad'); ...@@ -39,7 +39,7 @@ INSERT INTO BOX_TBL (f1) VALUES ('asdfasdf(ad');
SELECT '' AS four, BOX_TBL.*; SELECT '' AS four, BOX_TBL.*;
SELECT '' AS four, b.*, box_area(b.f1) as barea SELECT '' AS four, b.*, area(b.f1) as barea
FROM BOX_TBL b; FROM BOX_TBL b;
-- overlap -- overlap
......
...@@ -60,7 +60,11 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1 ...@@ -60,7 +60,11 @@ SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
SELECT '' AS five, f.f1, f.f1 % AS round_f1 SELECT '' AS five, f.f1, f.f1 % AS round_f1
FROM FLOAT8_TBL f; FROM FLOAT8_TBL f;
SELECT sqrt(float8 '64') AS eight;
-- square root -- square root
SELECT |/ float8 '64' AS eight;
SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
FROM FLOAT8_TBL f FROM FLOAT8_TBL f
WHERE f.f1 > '0.0'; WHERE f.f1 > '0.0';
...@@ -71,6 +75,8 @@ SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1 ...@@ -71,6 +75,8 @@ SELECT '' AS three, f.f1, : ( ; f.f1) AS exp_ln_f1
WHERE f.f1 > '0.0'; WHERE f.f1 > '0.0';
-- cube root -- cube root
SELECT ||/ float8 '27' AS three;
SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f; SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
...@@ -94,7 +100,7 @@ SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f; ...@@ -94,7 +100,7 @@ SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
SELECT '' AS five, FLOAT8_TBL.*; SELECT '' AS five, FLOAT8_TBL.*;
-- test for over and under flow -- test for over- and underflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
......
...@@ -85,7 +85,7 @@ SELECT '' AS twenty, b.f1 / p.f1 AS rotation ...@@ -85,7 +85,7 @@ SELECT '' AS twenty, b.f1 / p.f1 AS rotation
SET geqo TO 'off'; SET geqo TO 'off';
SELECT '' AS eight, points(f1) AS npoints, f1 AS path FROM PATH_TBL; SELECT '' AS eight, npoints(f1) AS npoints, f1 AS path FROM PATH_TBL;
SELECT '' AS four, path(f1) FROM POLYGON_TBL; SELECT '' AS four, path(f1) FROM POLYGON_TBL;
...@@ -110,7 +110,7 @@ SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains ...@@ -110,7 +110,7 @@ SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
FROM POLYGON_TBL poly, POINT_TBL p; FROM POLYGON_TBL poly, POINT_TBL p;
SELECT '' AS four, points(f1) AS npoints, f1 AS polygon SELECT '' AS four, npoints(f1) AS npoints, f1 AS polygon
FROM POLYGON_TBL; FROM POLYGON_TBL;
SELECT '' AS four, polygon(f1) SELECT '' AS four, polygon(f1)
......
...@@ -103,10 +103,3 @@ SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten; ...@@ -103,10 +103,3 @@ SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten;
SELECT 2 + 2 / 2 AS three; SELECT 2 + 2 / 2 AS three;
SELECT (2 + 2) / 2 AS two; SELECT (2 + 2) / 2 AS two;
SELECT dsqrt(float8 '64') AS eight;
SELECT |/float8 '64' AS eight;
SELECT ||/float8 '27' AS three;
...@@ -623,10 +623,10 @@ SELECT t1.id1, t1.result, t2.expected ...@@ -623,10 +623,10 @@ SELECT t1.id1, t1.result, t2.expected
AND t1.result != t2.expected; AND t1.result != t2.expected;
-- ****************************** -- ******************************
-- * POWER(10, LN(value)) check -- * POW(10, LN(value)) check
-- ****************************** -- ******************************
DELETE FROM num_result; DELETE FROM num_result;
INSERT INTO num_result SELECT id, 0, POWER(numeric '10', LN(ABS(round(val,200)))) INSERT INTO num_result SELECT id, 0, POW(numeric '10', LN(ABS(round(val,200))))
FROM num_data FROM num_data
WHERE val != '0.0'; WHERE val != '0.0';
SELECT t1.id1, t1.result, t2.expected SELECT t1.id1, t1.result, t2.expected
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
-- Shorthand values -- Shorthand values
-- Not directly usable for regression testing since these are not constants. -- Not directly usable for regression testing since these are not constants.
-- So, just try to test parser and hope for the best - tgl 97/04/26 -- So, just try to test parser and hope for the best - thomas 97/04/26
SELECT (timestamp 'today' = (timestamp 'yesterday' + interval '1 day')) as "True"; SELECT (timestamp 'today' = (timestamp 'yesterday' + interval '1 day')) as "True";
SELECT (timestamp 'today' = (timestamp 'tomorrow' - interval '1 day')) as "True"; SELECT (timestamp 'today' = (timestamp 'tomorrow' - interval '1 day')) as "True";
...@@ -12,8 +12,10 @@ SELECT (timestamp 'tomorrow' = (timestamp 'yesterday' + interval '2 days')) as " ...@@ -12,8 +12,10 @@ SELECT (timestamp 'tomorrow' = (timestamp 'yesterday' + interval '2 days')) as "
SELECT (timestamp 'current' = 'now') as "True"; SELECT (timestamp 'current' = 'now') as "True";
SELECT (timestamp 'now' - 'current') AS "ZeroSecs"; SELECT (timestamp 'now' - 'current') AS "ZeroSecs";
SET DateStyle = 'Postgres,noneuropean'; SET DateStyle = 'Postgres,NonEuropean';
SELECT timestamp('1994-01-01', '11:00') AS "Jan_01_1994_11am"; SELECT timestamp(date '1994-01-01', time '11:00') AS "Jan_01_1994_11am";
SELECT timestamp(date '1994-01-01', time '10:00') AS "Jan_01_1994_10am";
SELECT timestamp(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
CREATE TABLE TIMESTAMP_TBL ( d1 timestamp); CREATE TABLE TIMESTAMP_TBL ( d1 timestamp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment