mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Error message editing in backend/optimizer, backend/rewrite.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepjointree.c,v 1.7 2003/03/10 03:53:50 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepjointree.c,v 1.8 2003/07/25 00:01:08 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -334,17 +334,19 @@ pull_up_subqueries(Query *parse, Node *jtnode, bool below_outer_join)
|
||||
* This is where we fail if upper levels of planner
|
||||
* haven't rewritten UNION JOIN as an Append ...
|
||||
*/
|
||||
elog(ERROR, "UNION JOIN is not implemented yet");
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("UNION JOIN is not implemented yet")));
|
||||
break;
|
||||
default:
|
||||
elog(ERROR, "pull_up_subqueries: unexpected join type %d",
|
||||
j->jointype);
|
||||
elog(ERROR, "unrecognized join type: %d",
|
||||
(int) j->jointype);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
elog(ERROR, "pull_up_subqueries: unexpected node type %d",
|
||||
nodeTag(jtnode));
|
||||
elog(ERROR, "unrecognized node type: %d",
|
||||
(int) nodeTag(jtnode));
|
||||
return jtnode;
|
||||
}
|
||||
|
||||
@@ -363,7 +365,7 @@ is_simple_subquery(Query *subquery)
|
||||
subquery->commandType != CMD_SELECT ||
|
||||
subquery->resultRelation != 0 ||
|
||||
subquery->into != NULL)
|
||||
elog(ERROR, "is_simple_subquery: subquery is bogus");
|
||||
elog(ERROR, "subquery is bogus");
|
||||
|
||||
/*
|
||||
* Can't currently pull up a query with setops. Maybe after querytree
|
||||
@@ -478,8 +480,8 @@ resolvenew_in_jointree(Node *jtnode, int varno, List *subtlist)
|
||||
*/
|
||||
}
|
||||
else
|
||||
elog(ERROR, "resolvenew_in_jointree: unexpected node type %d",
|
||||
nodeTag(jtnode));
|
||||
elog(ERROR, "unrecognized node type: %d",
|
||||
(int) nodeTag(jtnode));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -524,7 +526,7 @@ reduce_outer_joins(Query *parse)
|
||||
|
||||
/* planner.c shouldn't have called me if no outer joins */
|
||||
if (state == NULL || !state->contains_outer)
|
||||
elog(ERROR, "reduce_outer_joins: so where are the outer joins?");
|
||||
elog(ERROR, "so where are the outer joins?");
|
||||
|
||||
reduce_outer_joins_pass2((Node *) parse->jointree, state, parse, NULL);
|
||||
}
|
||||
@@ -591,8 +593,8 @@ reduce_outer_joins_pass1(Node *jtnode)
|
||||
result->sub_states = lappend(result->sub_states, sub_state);
|
||||
}
|
||||
else
|
||||
elog(ERROR, "reduce_outer_joins_pass1: unexpected node type %d",
|
||||
nodeTag(jtnode));
|
||||
elog(ERROR, "unrecognized node type: %d",
|
||||
(int) nodeTag(jtnode));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -615,10 +617,10 @@ reduce_outer_joins_pass2(Node *jtnode,
|
||||
* because it's only called on subtrees marked as contains_outer.
|
||||
*/
|
||||
if (jtnode == NULL)
|
||||
elog(ERROR, "reduce_outer_joins_pass2: reached empty jointree");
|
||||
elog(ERROR, "reached empty jointree");
|
||||
if (IsA(jtnode, RangeTblRef))
|
||||
{
|
||||
elog(ERROR, "reduce_outer_joins_pass2: reached base rel");
|
||||
elog(ERROR, "reached base rel");
|
||||
}
|
||||
else if (IsA(jtnode, FromExpr))
|
||||
{
|
||||
@@ -735,8 +737,8 @@ reduce_outer_joins_pass2(Node *jtnode,
|
||||
}
|
||||
}
|
||||
else
|
||||
elog(ERROR, "reduce_outer_joins_pass2: unexpected node type %d",
|
||||
nodeTag(jtnode));
|
||||
elog(ERROR, "unrecognized node type: %d",
|
||||
(int) nodeTag(jtnode));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -972,8 +974,8 @@ simplify_jointree(Query *parse, Node *jtnode)
|
||||
}
|
||||
}
|
||||
else
|
||||
elog(ERROR, "simplify_jointree: unexpected node type %d",
|
||||
nodeTag(jtnode));
|
||||
elog(ERROR, "unrecognized node type: %d",
|
||||
(int) nodeTag(jtnode));
|
||||
return jtnode;
|
||||
}
|
||||
|
||||
@@ -1043,8 +1045,8 @@ get_relids_in_jointree(Node *jtnode)
|
||||
result = bms_join(result, get_relids_in_jointree(j->rarg));
|
||||
}
|
||||
else
|
||||
elog(ERROR, "get_relids_in_jointree: unexpected node type %d",
|
||||
nodeTag(jtnode));
|
||||
elog(ERROR, "unrecognized node type: %d",
|
||||
(int) nodeTag(jtnode));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1061,7 +1063,7 @@ get_relids_for_join(Query *parse, int joinrelid)
|
||||
|
||||
jtnode = find_jointree_node_for_rel((Node *) parse->jointree, joinrelid);
|
||||
if (!jtnode)
|
||||
elog(ERROR, "get_relids_for_join: join node %d not found", joinrelid);
|
||||
elog(ERROR, "could not find join node %d", joinrelid);
|
||||
return get_relids_in_jointree(jtnode);
|
||||
}
|
||||
|
||||
@@ -1108,7 +1110,7 @@ find_jointree_node_for_rel(Node *jtnode, int relid)
|
||||
return jtnode;
|
||||
}
|
||||
else
|
||||
elog(ERROR, "find_jointree_node_for_rel: unexpected node type %d",
|
||||
nodeTag(jtnode));
|
||||
elog(ERROR, "unrecognized node type: %d",
|
||||
(int) nodeTag(jtnode));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.61 2003/05/12 00:17:03 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.62 2003/07/25 00:01:08 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -55,7 +55,7 @@ preprocess_targetlist(List *tlist,
|
||||
RangeTblEntry *rte = rt_fetch(result_relation, range_table);
|
||||
|
||||
if (rte->subquery != NULL || rte->relid == InvalidOid)
|
||||
elog(ERROR, "preprocess_targetlist: subquery cannot be result relation");
|
||||
elog(ERROR, "subquery cannot be result relation");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -236,7 +236,8 @@ expand_targetlist(List *tlist, int command_type,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
elog(ERROR, "expand_targetlist: unexpected command_type");
|
||||
elog(ERROR, "unrecognized command_type: %d",
|
||||
(int) command_type);
|
||||
new_expr = NULL; /* keep compiler quiet */
|
||||
break;
|
||||
}
|
||||
@@ -266,7 +267,7 @@ expand_targetlist(List *tlist, int command_type,
|
||||
Resdom *resdom = old_tle->resdom;
|
||||
|
||||
if (!resdom->resjunk)
|
||||
elog(ERROR, "expand_targetlist: targetlist is not sorted correctly");
|
||||
elog(ERROR, "targetlist is not sorted correctly");
|
||||
/* Get the resno right, but don't copy unnecessarily */
|
||||
if (resdom->resno != attrno)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.99 2003/07/20 21:56:34 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.100 2003/07/25 00:01:08 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -195,7 +195,7 @@ recurse_set_operations(Node *setOp, Query *parse,
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "recurse_set_operations: unexpected node %d",
|
||||
elog(ERROR, "unrecognized node type: %d",
|
||||
(int) nodeTag(setOp));
|
||||
return NULL; /* keep compiler quiet */
|
||||
}
|
||||
@@ -312,7 +312,8 @@ generate_nonunion_plan(SetOperationStmt *op, Query *parse,
|
||||
cmd = op->all ? SETOPCMD_EXCEPT_ALL : SETOPCMD_EXCEPT;
|
||||
break;
|
||||
default:
|
||||
elog(ERROR, "generate_nonunion_plan: bogus operation code");
|
||||
elog(ERROR, "unrecognized set operation code: %d",
|
||||
(int) op->op);
|
||||
cmd = SETOPCMD_INTERSECT; /* keep compiler quiet */
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user