diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-07-25 00:01:09 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-07-25 00:01:09 +0000 |
commit | 45708f5ebcee7df4e684d4fb5ae7b1856dfcefa1 (patch) | |
tree | 178adf2e2a5fe80477bfd5a87589d961a1387d32 /src/backend/optimizer | |
parent | cfa191f3b8115b37c526cc1eee3dd1d2af7c11ca (diff) | |
download | postgresql-45708f5ebcee7df4e684d4fb5ae7b1856dfcefa1.tar.gz postgresql-45708f5ebcee7df4e684d4fb5ae7b1856dfcefa1.zip |
Error message editing in backend/optimizer, backend/rewrite.
Diffstat (limited to 'src/backend/optimizer')
24 files changed, 187 insertions, 173 deletions
diff --git a/src/backend/optimizer/geqo/geqo_erx.c b/src/backend/optimizer/geqo/geqo_erx.c index fe0baa42f1c..86b471f1cd0 100644 --- a/src/backend/optimizer/geqo/geqo_erx.c +++ b/src/backend/optimizer/geqo/geqo_erx.c @@ -3,7 +3,7 @@ * geqo_erx.c * edge recombination crossover [ER] * -* $Id: geqo_erx.c,v 1.17 2002/03/02 21:39:26 momjian Exp $ +* $Id: geqo_erx.c,v 1.18 2003/07/25 00:01:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -333,7 +333,7 @@ gimme_gene(Edge edge, Edge *edge_table) minimum_count = 1; } else if (minimum_count == -1) - elog(ERROR, "gimme_gene: Internal error - minimum_count not set"); + elog(ERROR, "minimum_count not set"); else if (edge_table[(int) friend].unused_edges == minimum_edges) minimum_count++; @@ -359,7 +359,7 @@ gimme_gene(Edge edge, Edge *edge_table) } /* ... should never be reached */ - elog(ERROR, "gimme_gene: neither shared nor minimum number nor random edge found"); + elog(ERROR, "neither shared nor minimum number nor random edge found"); return 0; /* to keep the compiler quiet */ } @@ -419,15 +419,11 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene) } } - elog(LOG, "edge_failure(1): no edge found via random decision and total_edges == 4"); + elog(LOG, "no edge found via random decision and total_edges == 4"); } - - else -/* random decision of the gene with remaining edges */ - - if (remaining_edges != 0) + else if (remaining_edges != 0) { - + /* random decision of the gene with remaining edges */ rand_decision = (int) geqo_randint(remaining_edges - 1, 0); for (i = 1; i <= num_gene; i++) @@ -444,7 +440,7 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene) } } - elog(LOG, "edge_failure(2): no edge found via random decision and remainig edges"); + elog(LOG, "no edge found via random decision with remaining edges"); } /* @@ -462,11 +458,11 @@ edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene) if (edge_table[i].unused_edges >= 0) return (Gene) i; - elog(LOG, "edge_failure(3): no edge found via looking for the last ununsed point"); + elog(LOG, "no edge found via looking for the last ununsed point"); } -/* ... should never be reached */ - elog(ERROR, "edge_failure: no edge detected"); + /* ... should never be reached */ + elog(ERROR, "no edge found"); return 0; /* to keep the compiler quiet */ } diff --git a/src/backend/optimizer/geqo/geqo_eval.c b/src/backend/optimizer/geqo/geqo_eval.c index 1be69e93f35..ee06560ca23 100644 --- a/src/backend/optimizer/geqo/geqo_eval.c +++ b/src/backend/optimizer/geqo/geqo_eval.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.62 2003/05/02 20:54:34 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/geqo_eval.c,v 1.63 2003/07/25 00:01:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -66,7 +66,7 @@ geqo_eval(Query *root, List *initial_rels, Gene *tour, int num_gene) * Since geqo_eval() will be called many times, we can't afford to let * all that memory go unreclaimed until end of statement. Note we * make the temp context a child of the planner's normal context, so that - * it will be freed even if we abort via elog(ERROR). + * it will be freed even if we abort via ereport(ERROR). */ mycontext = AllocSetContextCreate(CurrentMemoryContext, "GEQO", diff --git a/src/backend/optimizer/geqo/geqo_main.c b/src/backend/optimizer/geqo/geqo_main.c index c4190ac4443..f60fd7d4667 100644 --- a/src/backend/optimizer/geqo/geqo_main.c +++ b/src/backend/optimizer/geqo/geqo_main.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/geqo_main.c,v 1.35 2003/05/27 17:49:46 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/geqo_main.c,v 1.36 2003/07/25 00:01:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -120,30 +120,30 @@ geqo(Query *root, int number_of_rels, List *initial_rels) daddy = alloc_chromo(pool->string_length); #if defined (ERX) - elog(DEBUG2, "geqo_main: using edge recombination crossover [ERX]"); + elog(DEBUG2, "using edge recombination crossover [ERX]"); /* allocate edge table memory */ edge_table = alloc_edge_table(pool->string_length); #elif defined(PMX) - elog(DEBUG2, "geqo_main: using partially matched crossover [PMX]"); + elog(DEBUG2, "using partially matched crossover [PMX]"); /* allocate chromosome kid memory */ kid = alloc_chromo(pool->string_length); #elif defined(CX) - elog(DEBUG2, "geqo_main: using cycle crossover [CX]"); + elog(DEBUG2, "using cycle crossover [CX]"); /* allocate city table memory */ kid = alloc_chromo(pool->string_length); city_table = alloc_city_table(pool->string_length); #elif defined(PX) - elog(DEBUG2, "geqo_main: using position crossover [PX]"); + elog(DEBUG2, "using position crossover [PX]"); /* allocate city table memory */ kid = alloc_chromo(pool->string_length); city_table = alloc_city_table(pool->string_length); #elif defined(OX1) - elog(DEBUG2, "geqo_main: using order crossover [OX1]"); + elog(DEBUG2, "using order crossover [OX1]"); /* allocate city table memory */ kid = alloc_chromo(pool->string_length); city_table = alloc_city_table(pool->string_length); #elif defined(OX2) - elog(DEBUG2, "geqo_main: using order crossover [OX2]"); + elog(DEBUG2, "using order crossover [OX2]"); /* allocate city table memory */ kid = alloc_chromo(pool->string_length); city_table = alloc_city_table(pool->string_length); @@ -211,7 +211,7 @@ geqo(Query *root, int number_of_rels, List *initial_rels) elog(LOG, "[GEQO] failures: %d, average: %d", edge_failures, (int) generation / edge_failures); else - elog(LOG, "[GEQO] No edge failures detected."); + elog(LOG, "[GEQO] no edge failures detected"); #endif @@ -219,7 +219,7 @@ geqo(Query *root, int number_of_rels, List *initial_rels) if (mutations != 0) elog(LOG, "[GEQO] mutations: %d, generations: %d", mutations, generation); else - elog(LOG, "[GEQO] No mutations processed."); + elog(LOG, "[GEQO] no mutations processed"); #endif @@ -239,7 +239,7 @@ geqo(Query *root, int number_of_rels, List *initial_rels) best_tour, pool->string_length); if (best_rel == NULL) - elog(ERROR, "geqo: failed to make a valid plan"); + elog(ERROR, "failed to make a valid plan"); /* DBG: show the query plan */ #ifdef NOT_USED diff --git a/src/backend/optimizer/geqo/geqo_misc.c b/src/backend/optimizer/geqo/geqo_misc.c index 7cf3a5a14d5..acc9285d005 100644 --- a/src/backend/optimizer/geqo/geqo_misc.c +++ b/src/backend/optimizer/geqo/geqo_misc.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/geqo_misc.c,v 1.36 2002/12/16 21:30:29 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/geqo_misc.c,v 1.37 2003/07/25 00:01:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -38,7 +38,7 @@ avg_pool(Pool *pool) double cumulative = 0.0; if (pool->size <= 0) - elog(ERROR, "avg_pool: pool_size of zero"); + elog(ERROR, "pool_size is zero"); /* * Since the pool may contain multiple occurrences of DBL_MAX, divide diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index cd04af9f821..486dede0fb9 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.103 2003/06/29 23:05:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.104 2003/07/25 00:01:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -209,7 +209,9 @@ set_inherited_rel_pathlist(Query *root, RelOptInfo *rel, * do better? */ if (intMember(parentRTindex, root->rowMarks)) - elog(ERROR, "SELECT FOR UPDATE is not supported for inherit queries"); + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("SELECT FOR UPDATE is not supported for inherit queries"))); /* * The executor will check the parent table's access permissions when @@ -642,7 +644,7 @@ recurse_pushdown_safe(Node *setOp, Query *topquery, } else { - elog(ERROR, "recurse_pushdown_safe: unexpected node %d", + elog(ERROR, "unrecognized node type: %d", (int) nodeTag(setOp)); } return true; @@ -839,7 +841,7 @@ recurse_push_qual(Node *setOp, Query *topquery, } else { - elog(ERROR, "recurse_push_qual: unexpected node %d", + elog(ERROR, "unrecognized node type: %d", (int) nodeTag(setOp)); } } diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index 3011f687c59..e1754a7a694 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -49,7 +49,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.110 2003/07/14 22:35:54 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.111 2003/07/25 00:01:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1513,7 +1513,7 @@ cost_qual_eval_walker(Node *node, QualCost *total) else if (IsA(node, SubLink)) { /* This routine should not be applied to un-planned expressions */ - elog(ERROR, "cost_qual_eval: can't handle unplanned sub-select"); + elog(ERROR, "cannot handle unplanned sub-select"); } else if (IsA(node, SubPlan)) { @@ -1805,8 +1805,7 @@ set_joinrel_size_estimates(Query *root, RelOptInfo *rel, temp = inner_rel->rows; break; default: - elog(ERROR, "set_joinrel_size_estimates: unsupported join type %d", - (int) jointype); + elog(ERROR, "unrecognized join type: %d", (int) jointype); temp = 0; /* keep compiler quiet */ break; } diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index fbbf983869c..fa19abe4717 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.144 2003/06/15 22:51:45 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.145 2003/07/25 00:01:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -490,7 +490,7 @@ extract_or_indexqual_conditions(RelOptInfo *rel, } while (!DoneMatchingIndexKeys(classes)); if (FastListValue(&quals) == NIL) - elog(ERROR, "extract_or_indexqual_conditions: no matching clause"); + elog(ERROR, "no matching OR clause"); return FastListValue(&quals); } @@ -1245,7 +1245,7 @@ pred_test_simple_clause(Expr *predicate, Node *clause) if (!OidIsValid(test_op)) { /* This should not fail, else pg_amop entry is missing */ - elog(ERROR, "Missing pg_amop entry for opclass %u strategy %d", + elog(ERROR, "missing pg_amop entry for opclass %u strategy %d", opclass_id, test_strategy); } @@ -1281,7 +1281,7 @@ pred_test_simple_clause(Expr *predicate, Node *clause) if (isNull) { /* Treat a null result as false ... but it's a tad fishy ... */ - elog(DEBUG2, "pred_test_simple_clause: null test result"); + elog(DEBUG2, "null predicate test result"); return false; } return DatumGetBool(test_result); @@ -2055,7 +2055,8 @@ prefix_quals(Node *leftop, Oid opclass, break; default: - elog(ERROR, "prefix_quals: unexpected opclass %u", opclass); + /* shouldn't get here */ + elog(ERROR, "unexpected opclass: %u", opclass); return NIL; } @@ -2078,7 +2079,7 @@ prefix_quals(Node *leftop, Oid opclass, prefix_const->constvalue)); break; default: - elog(ERROR, "prefix_quals: unexpected consttype %u", + elog(ERROR, "unexpected const type: %u", prefix_const->consttype); return NIL; } @@ -2093,7 +2094,7 @@ prefix_quals(Node *leftop, Oid opclass, { oproid = get_opclass_member(opclass, BTEqualStrategyNumber); if (oproid == InvalidOid) - elog(ERROR, "prefix_quals: no operator = for opclass %u", opclass); + elog(ERROR, "no = operator for opclass %u", opclass); expr = make_opclause(oproid, BOOLOID, false, (Expr *) leftop, (Expr *) prefix_const); result = makeList1(expr); @@ -2107,7 +2108,7 @@ prefix_quals(Node *leftop, Oid opclass, */ oproid = get_opclass_member(opclass, BTGreaterEqualStrategyNumber); if (oproid == InvalidOid) - elog(ERROR, "prefix_quals: no operator >= for opclass %u", opclass); + elog(ERROR, "no >= operator for opclass %u", opclass); expr = make_opclause(oproid, BOOLOID, false, (Expr *) leftop, (Expr *) prefix_const); result = makeList1(expr); @@ -2122,7 +2123,7 @@ prefix_quals(Node *leftop, Oid opclass, { oproid = get_opclass_member(opclass, BTLessStrategyNumber); if (oproid == InvalidOid) - elog(ERROR, "prefix_quals: no operator < for opclass %u", opclass); + elog(ERROR, "no < operator for opclass %u", opclass); expr = make_opclause(oproid, BOOLOID, false, (Expr *) leftop, (Expr *) greaterstr); result = lappend(result, expr); @@ -2167,8 +2168,7 @@ network_prefix_quals(Node *leftop, Oid expr_op, Oid opclass, Datum rightop) is_eq = true; break; default: - elog(ERROR, "network_prefix_quals: unexpected operator %u", - expr_op); + elog(ERROR, "unexpected operator: %u", expr_op); return NIL; } @@ -2180,15 +2180,13 @@ network_prefix_quals(Node *leftop, Oid expr_op, Oid opclass, Datum rightop) { opr1oid = get_opclass_member(opclass, BTGreaterEqualStrategyNumber); if (opr1oid == InvalidOid) - elog(ERROR, "network_prefix_quals: no >= operator for opclass %u", - opclass); + elog(ERROR, "no >= operator for opclass %u", opclass); } else { opr1oid = get_opclass_member(opclass, BTGreaterStrategyNumber); if (opr1oid == InvalidOid) - elog(ERROR, "network_prefix_quals: no > operator for opclass %u", - opclass); + elog(ERROR, "no > operator for opclass %u", opclass); } opr1right = network_scan_first(rightop); @@ -2203,8 +2201,7 @@ network_prefix_quals(Node *leftop, Oid expr_op, Oid opclass, Datum rightop) opr2oid = get_opclass_member(opclass, BTLessEqualStrategyNumber); if (opr2oid == InvalidOid) - elog(ERROR, "network_prefix_quals: no <= operator for opclass %u", - opclass); + elog(ERROR, "no <= operator for opclass %u", opclass); opr2right = network_scan_last(rightop); diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c index c8175b81e39..cf7c4ee4331 100644 --- a/src/backend/optimizer/path/joinpath.c +++ b/src/backend/optimizer/path/joinpath.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.78 2003/02/08 20:20:54 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.79 2003/07/25 00:01:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -165,7 +165,7 @@ sort_inner_and_outer(Query *root, useallclauses = true; break; default: - elog(ERROR, "sort_inner_and_outer: unexpected join type %d", + elog(ERROR, "unrecognized join type: %d", (int) jointype); useallclauses = false; /* keep compiler quiet */ break; @@ -363,7 +363,7 @@ match_unsorted_outer(Query *root, useallclauses = true; break; default: - elog(ERROR, "match_unsorted_outer: unexpected join type %d", + elog(ERROR, "unrecognized join type: %d", (int) jointype); nestjoinOK = false; /* keep compiler quiet */ useallclauses = false; @@ -815,7 +815,9 @@ select_mergejoin_clauses(RelOptInfo *joinrel, case JOIN_FULL: if (restrictinfo->left_relids == NULL || restrictinfo->mergejoinoperator == InvalidOid) - elog(ERROR, "FULL JOIN is only supported with mergejoinable join conditions"); + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("FULL JOIN is only supported with mergejoinable join conditions"))); break; default: /* otherwise, it's OK to have nonmergeable join quals */ diff --git a/src/backend/optimizer/path/joinrels.c b/src/backend/optimizer/path/joinrels.c index 260b0cf6cd0..023bc397840 100644 --- a/src/backend/optimizer/path/joinrels.c +++ b/src/backend/optimizer/path/joinrels.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.60 2003/02/08 20:20:54 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.61 2003/07/25 00:01:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -227,8 +227,7 @@ make_rels_by_joins(Query *root, int level, List **joinrels) } if (result_rels == NIL) - elog(ERROR, "make_rels_by_joins: failed to build any %d-way joins", - level); + elog(ERROR, "failed to build any %d-way joins", level); } return result_rels; @@ -367,8 +366,8 @@ make_jointree_rel(Query *root, Node *jtnode) /* Make this join rel */ rel = make_join_rel(root, lrel, rrel, j->jointype); - if (rel == NULL) - elog(ERROR, "make_jointree_rel: invalid join order!?"); + if (rel == NULL) /* oops */ + elog(ERROR, "invalid join order"); /* * Since we are only going to consider this one way to do it, @@ -385,8 +384,8 @@ make_jointree_rel(Query *root, Node *jtnode) return rel; } else - elog(ERROR, "make_jointree_rel: unexpected node type %d", - nodeTag(jtnode)); + elog(ERROR, "unrecognized node type: %d", + (int) nodeTag(jtnode)); return NULL; /* keep compiler quiet */ } @@ -571,7 +570,7 @@ make_join_rel(Query *root, RelOptInfo *rel1, RelOptInfo *rel2, restrictlist); break; default: - elog(ERROR, "make_join_rel: unsupported join type %d", + elog(ERROR, "unrecognized join type: %d", (int) jointype); break; } diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c index d4d1179d545..9fec73e2603 100644 --- a/src/backend/optimizer/path/pathkeys.c +++ b/src/backend/optimizer/path/pathkeys.c @@ -11,7 +11,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/pathkeys.c,v 1.50 2003/06/29 23:05:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/pathkeys.c,v 1.51 2003/07/25 00:01:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1089,7 +1089,7 @@ make_pathkeys_for_mergeclauses(Query *root, } else { - elog(ERROR, "make_pathkeys_for_mergeclauses: can't identify which side of mergeclause to use"); + elog(ERROR, "could not identify which side of mergeclause to use"); pathkey = NIL; /* keep compiler quiet */ } diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 79855b00c0f..9ac746d34a9 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.148 2003/07/14 22:35:54 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.149 2003/07/25 00:01:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -155,8 +155,8 @@ create_plan(Query *root, Path *best_path) (UniquePath *) best_path); break; default: - elog(ERROR, "create_plan: unknown pathtype %d", - best_path->pathtype); + elog(ERROR, "unrecognized node type: %d", + (int) best_path->pathtype); plan = NULL; /* keep compiler quiet */ break; } @@ -252,8 +252,8 @@ create_scan_plan(Query *root, Path *best_path) break; default: - elog(ERROR, "create_scan_plan: unknown node type: %d", - best_path->pathtype); + elog(ERROR, "unrecognized node type: %d", + (int) best_path->pathtype); plan = NULL; /* keep compiler quiet */ break; } @@ -384,8 +384,8 @@ create_join_plan(Query *root, JoinPath *best_path) inner_plan); break; default: - elog(ERROR, "unsupported node type %d", - best_path->path.pathtype); + elog(ERROR, "unrecognized node type: %d", + (int) best_path->path.pathtype); plan = NULL; /* keep compiler quiet */ break; } @@ -1172,7 +1172,7 @@ fix_indxqual_sublist(List *indexqual, Oid opclass; if (!IsA(clause, OpExpr) || length(clause->args) != 2) - elog(ERROR, "fix_indxqual_sublist: indexqual clause is not binary opclause"); + elog(ERROR, "indexqual clause is not binary opclause"); /* * Make a copy that will become the fixed clause. @@ -1287,7 +1287,7 @@ fix_indxqual_operand(Node *node, int baserelid, IndexOptInfo *index, } /* Ooops... */ - elog(ERROR, "fix_indxqual_operand: node is not index attribute"); + elog(ERROR, "node is not an index attribute"); return NULL; /* keep compiler quiet */ } @@ -1804,7 +1804,7 @@ make_sort_from_pathkeys(Query *root, Plan *lefttree, break; } if (!j) - elog(ERROR, "make_sort_from_pathkeys: cannot find pathkey item to sort"); + elog(ERROR, "could not find pathkey item to sort"); /* * Do we need to insert a Result node? * diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c index cbc1ff365a3..02f6e0c4c50 100644 --- a/src/backend/optimizer/plan/initsplan.c +++ b/src/backend/optimizer/plan/initsplan.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.86 2003/06/29 23:05:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.87 2003/07/25 00:01:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -97,11 +97,13 @@ add_base_rels_to_query(Query *root, Node *jtnode) * Safety check: join RTEs should not be SELECT FOR UPDATE targets */ if (intMember(j->rtindex, root->rowMarks)) - elog(ERROR, "SELECT FOR UPDATE cannot be applied to a join"); + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("SELECT FOR UPDATE cannot be applied to a join"))); } else - elog(ERROR, "add_base_rels_to_query: unexpected node type %d", - nodeTag(jtnode)); + elog(ERROR, "unrecognized node type: %d", + (int) nodeTag(jtnode)); } @@ -284,11 +286,12 @@ distribute_quals_to_rels(Query *root, Node *jtnode) * 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, - "distribute_quals_to_rels: unsupported join type %d", + elog(ERROR, "unrecognized join type: %d", (int) j->jointype); break; } @@ -302,8 +305,8 @@ distribute_quals_to_rels(Query *root, Node *jtnode) mark_baserels_for_outer_join(root, nullable_rels, result); } else - elog(ERROR, "distribute_quals_to_rels: unexpected node type %d", - nodeTag(jtnode)); + elog(ERROR, "unrecognized node type: %d", + (int) nodeTag(jtnode)); return result; } @@ -340,7 +343,9 @@ mark_baserels_for_outer_join(Query *root, Relids rels, Relids outerrels) if (rel->outerjoinset == NULL) { if (intMember(relno, root->rowMarks)) - elog(ERROR, "SELECT FOR UPDATE cannot be applied to the nullable side of an OUTER JOIN"); + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("SELECT FOR UPDATE cannot be applied to the nullable side of an OUTER JOIN"))); } rel->outerjoinset = outerrels; @@ -603,7 +608,7 @@ distribute_qual_to_rels(Query *root, Node *clause, * 'clause' references no rels, and therefore we have no place to * attach it. Shouldn't get here if callers are working properly. */ - elog(ERROR, "distribute_qual_to_rels: can't cope with variable-free clause"); + elog(ERROR, "cannot cope with variable-free clause"); break; } @@ -745,8 +750,10 @@ process_implied_equality(Query *root, * we have no suitable equality operator for the combination of * datatypes? NO, because sortkey selection may screw up anyway. */ - elog(ERROR, "Unable to identify an equality operator for types '%s' and '%s'", - format_type_be(ltype), format_type_be(rtype)); + ereport(ERROR, + (errcode(ERRCODE_UNDEFINED_FUNCTION), + errmsg("unable to identify an equality operator for types %s and %s", + format_type_be(ltype), format_type_be(rtype)))); } pgopform = (Form_pg_operator) GETSTRUCT(eq_operator); @@ -756,8 +763,10 @@ process_implied_equality(Query *root, if (pgopform->oprlsortop != sortop1 || pgopform->oprrsortop != sortop2 || pgopform->oprresult != BOOLOID) - elog(ERROR, "Equality operator for types '%s' and '%s' should be mergejoinable, but isn't", - format_type_be(ltype), format_type_be(rtype)); + ereport(ERROR, + (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), + errmsg("equality operator for types %s and %s should be mergejoinable, but isn't", + format_type_be(ltype), format_type_be(rtype)))); clause = make_opclause(oprid(eq_operator), /* opno */ BOOLOID, /* opresulttype */ diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c index 97f6b76a8e4..8883310f66d 100644 --- a/src/backend/optimizer/plan/planmain.c +++ b/src/backend/optimizer/plan/planmain.c @@ -14,7 +14,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.75 2003/03/10 03:53:50 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.76 2003/07/25 00:01:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -154,7 +154,7 @@ query_planner(Query *root, List *tlist, double tuple_fraction, final_rel = make_one_rel(root); if (!final_rel || !final_rel->cheapest_total_path) - elog(ERROR, "query_planner: failed to construct a relation"); + elog(ERROR, "failed to construct the join relation"); /* * Now that we have an estimate of the final rel's size, we can diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d058a44bb0d..1896982f02e 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.156 2003/07/03 19:07:20 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.157 2003/07/25 00:01:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -448,8 +448,8 @@ preprocess_qual_conditions(Query *parse, Node *jtnode) j->quals = preprocess_expression(parse, j->quals, EXPRKIND_QUAL); } else - elog(ERROR, "preprocess_qual_conditions: unexpected node type %d", - nodeTag(jtnode)); + elog(ERROR, "unrecognized node type: %d", + (int) nodeTag(jtnode)); } /*-------------------- @@ -582,7 +582,9 @@ grouping_planner(Query *parse, double tuple_fraction) * already, but let's make sure). */ if (parse->rowMarks) - elog(ERROR, "SELECT FOR UPDATE is not allowed with UNION/INTERSECT/EXCEPT"); + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("SELECT FOR UPDATE is not allowed with UNION/INTERSECT/EXCEPT"))); /* * We set current_pathkeys NIL indicating we do not know sort @@ -646,7 +648,9 @@ grouping_planner(Query *parse, double tuple_fraction) * level */ if (PlannerQueryLevel > 1) - elog(ERROR, "SELECT FOR UPDATE is not allowed in subselects"); + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("SELECT FOR UPDATE is not allowed in subselects"))); foreach(l, parse->rowMarks) { @@ -1491,7 +1495,7 @@ locate_grouping_columns(Query *parse, break; } if (!sl) - elog(ERROR, "locate_grouping_columns: failed"); + elog(ERROR, "failed to locate grouping columns"); groupColIdx[keyno++] = te->resdom->resno; } @@ -1504,7 +1508,7 @@ locate_grouping_columns(Query *parse, * We need to transpose sort key info from the orig_tlist into new_tlist. * NOTE: this would not be good enough if we supported resjunk sort keys * for results of set operations --- then, we'd need to project a whole - * new tlist to evaluate the resjunk columns. For now, just elog if we + * new tlist to evaluate the resjunk columns. For now, just ereport if we * find any resjunk columns in orig_tlist. */ static List * @@ -1524,13 +1528,13 @@ postprocess_setop_tlist(List *new_tlist, List *orig_tlist) Assert(orig_tlist != NIL); orig_tle = (TargetEntry *) lfirst(orig_tlist); orig_tlist = lnext(orig_tlist); - if (orig_tle->resdom->resjunk) - elog(ERROR, "postprocess_setop_tlist: resjunk output columns not implemented"); + if (orig_tle->resdom->resjunk) /* should not happen */ + elog(ERROR, "resjunk output columns are not implemented"); Assert(new_tle->resdom->resno == orig_tle->resdom->resno); Assert(new_tle->resdom->restype == orig_tle->resdom->restype); new_tle->resdom->ressortgroupref = orig_tle->resdom->ressortgroupref; } if (orig_tlist != NIL) - elog(ERROR, "postprocess_setop_tlist: resjunk output columns not implemented"); + elog(ERROR, "resjunk output columns are not implemented"); return new_tlist; } diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c index 1da186e0aaa..18395be022b 100644 --- a/src/backend/optimizer/plan/setrefs.c +++ b/src/backend/optimizer/plan/setrefs.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.93 2003/06/29 00:33:43 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.94 2003/07/25 00:01:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -233,8 +233,8 @@ set_plan_references(Plan *plan, List *rtable) set_plan_references((Plan *) lfirst(pl), rtable); break; default: - elog(ERROR, "set_plan_references: unknown plan type %d", - nodeTag(plan)); + elog(ERROR, "unrecognized node type: %d", + (int) nodeTag(plan)); break; } @@ -584,7 +584,7 @@ join_references_mutator(Node *node, return (Node *) copyObject(var); /* No referent found for Var */ - elog(ERROR, "join_references: variable not in subplan target lists"); + elog(ERROR, "variable not found in subplan target lists"); } /* Try matching more complex expressions too, if tlists have any */ if (context->tlists_have_non_vars) @@ -680,7 +680,7 @@ replace_vars_with_subplan_refs_mutator(Node *node, resdom = tlist_member((Node *) var, context->subplan_targetlist); if (!resdom) - elog(ERROR, "replace_vars_with_subplan_refs: variable not in subplan target list"); + elog(ERROR, "variable not found in subplan target list"); newvar = (Var *) copyObject(var); newvar->varno = context->subvarno; newvar->varattno = resdom->resno; diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c index aee5f4a1a14..780bed6c2bf 100644 --- a/src/backend/optimizer/plan/subselect.c +++ b/src/backend/optimizer/plan/subselect.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.78 2003/06/25 21:30:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.79 2003/07/25 00:01:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -359,7 +359,7 @@ make_subplan(SubLink *slink, List *lefthand, bool isTopQual) Assert(!te->resdom->resjunk); arraytype = get_array_type(te->resdom->restype); if (!OidIsValid(arraytype)) - elog(ERROR, "Cannot find array type for datatype %s", + elog(ERROR, "could not find array type for datatype %s", format_type_be(te->resdom->restype)); prm = generate_new_param(arraytype, -1); node->setParam = makeListi1(prm->paramid); @@ -1012,8 +1012,8 @@ finalize_plan(Plan *plan, List *rtable, break; default: - elog(ERROR, "finalize_plan: node %d unsupported", - nodeTag(plan)); + elog(ERROR, "unrecognized node type: %d", + (int) nodeTag(plan)); } /* Process left and right child plans, if any */ @@ -1032,7 +1032,7 @@ finalize_plan(Plan *plan, List *rtable, /* Now we have all the paramids */ if (!bms_is_subset(context.paramids, valid_params)) - elog(ERROR, "finalize_plan: plan shouldn't reference subplan's variable"); + elog(ERROR, "plan should not reference subplan's variable"); plan->extParam = bms_intersect(context.paramids, outer_params); plan->allParam = context.paramids; diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c index a265623bfb7..6bddf04206f 100644 --- a/src/backend/optimizer/prep/prepjointree.c +++ b/src/backend/optimizer/prep/prepjointree.c @@ -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; } diff --git a/src/backend/optimizer/prep/preptlist.c b/src/backend/optimizer/prep/preptlist.c index 00132a53cde..9c937f17602 100644 --- a/src/backend/optimizer/prep/preptlist.c +++ b/src/backend/optimizer/prep/preptlist.c @@ -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) { diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index 029227a4ca6..065f5d9ccac 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -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; } diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index d35cbee92e7..5df7e1c3cb3 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.146 2003/07/03 19:07:25 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.147 2003/07/25 00:01:08 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -404,7 +404,9 @@ count_agg_clause_walker(Node *node, int *count) * nested agg functions are semantically nonsensical. */ if (contain_agg_clause((Node *) ((Aggref *) node)->target)) - elog(ERROR, "Aggregate function calls may not be nested"); + ereport(ERROR, + (errcode(ERRCODE_GROUPING_ERROR), + errmsg("aggregate function calls may not be nested"))); /* * Having checked that, we need not recurse into the argument. @@ -982,14 +984,15 @@ CommuteClause(OpExpr *clause) Oid opoid; Node *temp; + /* Sanity checks: caller is at fault if these fail */ if (!is_opclause(clause) || length(clause->args) != 2) - elog(ERROR, "CommuteClause: applied to non-binary-operator clause"); + elog(ERROR, "cannot commute non-binary-operator clause"); opoid = get_commutator(clause->opno); if (!OidIsValid(opoid)) - elog(ERROR, "CommuteClause: no commutator for operator %u", + elog(ERROR, "could not find commutator for operator %u", clause->opno); /* @@ -1346,7 +1349,7 @@ eval_const_expressions_mutator(Node *node, List *active_fns) /* Else we still need a NOT node */ return (Node *) make_notclause(lfirst(args)); default: - elog(ERROR, "eval_const_expressions: unexpected boolop %d", + elog(ERROR, "unrecognized boolop: %d", (int) expr->boolop); break; } @@ -1357,7 +1360,7 @@ eval_const_expressions_mutator(Node *node, List *active_fns) * Return a SubPlan unchanged --- too late to do anything * with it. * - * XXX should we elog() here instead? Probably this routine + * XXX should we ereport() here instead? Probably this routine * should never be invoked after SubPlan creation. */ return node; @@ -1610,7 +1613,7 @@ simplify_function(Oid funcid, Oid result_type, List *args, ObjectIdGetDatum(funcid), 0, 0, 0); if (!HeapTupleIsValid(func_tuple)) - elog(ERROR, "Function OID %u does not exist", funcid); + elog(ERROR, "cache lookup failed for function %u", funcid); newexpr = evaluate_function(funcid, result_type, args, func_tuple); @@ -1794,8 +1797,7 @@ inline_function(Oid funcid, Oid result_type, List *args, Anum_pg_proc_prosrc, &isNull); if (isNull) - elog(ERROR, "inline_function: null prosrc for procedure %u", - funcid); + elog(ERROR, "null prosrc for function %u", funcid); src = DatumGetCString(DirectFunctionCall1(textout, tmp)); /* @@ -1961,9 +1963,9 @@ substitute_actual_parameters_mutator(Node *node, Param *param = (Param *) node; if (param->paramkind != PARAM_NUM) - elog(ERROR, "substitute_actual_parameters_mutator: unexpected paramkind"); + elog(ERROR, "unexpected paramkind: %d", param->paramkind); if (param->paramid <= 0 || param->paramid > context->nargs) - elog(ERROR, "substitute_actual_parameters_mutator: unexpected paramid"); + elog(ERROR, "invalid paramid: %d", param->paramid); /* Count usage of parameter */ context->usecounts[param->paramid - 1]++; @@ -2350,8 +2352,8 @@ expression_tree_walker(Node *node, } break; default: - elog(ERROR, "expression_tree_walker: Unexpected node type %d", - nodeTag(node)); + elog(ERROR, "unrecognized node type: %d", + (int) nodeTag(node)); break; } return false; @@ -2816,8 +2818,8 @@ expression_tree_mutator(Node *node, } break; default: - elog(ERROR, "expression_tree_mutator: Unexpected node type %d", - nodeTag(node)); + elog(ERROR, "unrecognized node type: %d", + (int) nodeTag(node)); break; } /* can't get here, but keep compiler happy */ diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 19198bf2494..61ab51747c1 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.92 2003/07/14 22:35:54 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.93 2003/07/25 00:01:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -133,7 +133,7 @@ set_cheapest(RelOptInfo *parent_rel) Assert(IsA(parent_rel, RelOptInfo)); if (pathlist == NIL) - elog(ERROR, "Unable to devise a query plan for the given query"); + elog(ERROR, "could not devise a query plan for the given query"); cheapest_startup_path = cheapest_total_path = (Path *) lfirst(pathlist); diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 3f4fe661717..6823f03267e 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.84 2003/06/29 23:05:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.85 2003/07/25 00:01:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -258,7 +258,7 @@ restriction_selectivity(Query *root, Int32GetDatum(varRelid))); if (result < 0.0 || result > 1.0) - elog(ERROR, "restriction_selectivity: bad value %f", result); + elog(ERROR, "invalid restriction selectivity: %f", result); return (Selectivity) result; } @@ -293,7 +293,7 @@ join_selectivity(Query *root, Int16GetDatum(jointype))); if (result < 0.0 || result > 1.0) - elog(ERROR, "join_selectivity: bad value %f", result); + elog(ERROR, "invalid join selectivity: %f", result); return (Selectivity) result; } @@ -365,7 +365,7 @@ has_subclass(Oid relationId) ObjectIdGetDatum(relationId), 0, 0, 0); if (!HeapTupleIsValid(tuple)) - elog(ERROR, "has_subclass: Relation %u not found", relationId); + elog(ERROR, "cache lookup failed for relation %u", relationId); result = ((Form_pg_class) GETSTRUCT(tuple))->relhassubclass; ReleaseSysCache(tuple); diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c index 0b82569ba37..9a4a2069765 100644 --- a/src/backend/optimizer/util/relnode.c +++ b/src/backend/optimizer/util/relnode.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.49 2003/06/29 23:05:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.50 2003/07/25 00:01:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -55,7 +55,7 @@ build_base_rel(Query *root, int relid) { rel = (RelOptInfo *) lfirst(rels); if (relid == rel->relid) - elog(ERROR, "build_base_rel: rel already exists"); + elog(ERROR, "rel already exists"); } /* It should not exist as an "other" rel, either */ @@ -63,7 +63,7 @@ build_base_rel(Query *root, int relid) { rel = (RelOptInfo *) lfirst(rels); if (relid == rel->relid) - elog(ERROR, "build_base_rel: rel already exists as 'other' rel"); + elog(ERROR, "rel already exists as \"other\" rel"); } /* No existing RelOptInfo for this base rel, so make a new one */ @@ -98,7 +98,7 @@ build_other_rel(Query *root, int relid) { rel = (RelOptInfo *) lfirst(rels); if (relid == rel->relid) - elog(ERROR, "build_other_rel: rel already exists as base rel"); + elog(ERROR, "rel already exists as base rel"); } /* No existing RelOptInfo for this other rel, so make a new one */ @@ -165,7 +165,7 @@ make_base_rel(Query *root, int relid) rel->max_attr = length(rte->eref->colnames); break; default: - elog(ERROR, "make_base_rel: unsupported RTE kind %d", + elog(ERROR, "unrecognized RTE kind: %d", (int) rte->rtekind); break; } @@ -211,7 +211,7 @@ find_base_rel(Query *root, int relid) return rel; } - elog(ERROR, "find_base_rel: no relation entry for relid %d", relid); + elog(ERROR, "no relation entry for relid %d", relid); return NULL; /* keep compiler quiet */ } diff --git a/src/backend/optimizer/util/tlist.c b/src/backend/optimizer/util/tlist.c index 7a4422a3594..26d7d6fb245 100644 --- a/src/backend/optimizer/util/tlist.c +++ b/src/backend/optimizer/util/tlist.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.57 2003/06/29 23:05:05 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.58 2003/07/25 00:01:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -183,7 +183,7 @@ get_sortgroupclause_tle(SortClause *sortClause, return tle; } - elog(ERROR, "get_sortgroupclause_tle: ORDER/GROUP BY expression not found in targetlist"); + elog(ERROR, "ORDER/GROUP BY expression not found in targetlist"); return NULL; /* keep compiler quiet */ } |