* op_error - utility routine to complain about an unresolvable operator */
| 631 | * op_error - utility routine to complain about an unresolvable operator |
| 632 | */ |
| 633 | static void |
| 634 | op_error(ParseState *pstate, List *op, char oprkind, |
| 635 | Oid arg1, Oid arg2, |
| 636 | FuncDetailCode fdresult, int location) |
| 637 | { |
| 638 | if (fdresult == FUNCDETAIL_MULTIPLE) |
| 639 | ereport(ERROR, |
| 640 | (errcode(ERRCODE_AMBIGUOUS_FUNCTION), |
| 641 | errmsg("operator is not unique: %s", |
| 642 | op_signature_string(op, oprkind, arg1, arg2)), |
| 643 | errhint("Could not choose a best candidate operator. " |
| 644 | "You might need to add explicit type casts."), |
| 645 | parser_errposition(pstate, location))); |
| 646 | else |
| 647 | ereport(ERROR, |
| 648 | (errcode(ERRCODE_UNDEFINED_FUNCTION), |
| 649 | errmsg("operator does not exist: %s", |
| 650 | op_signature_string(op, oprkind, arg1, arg2)), |
| 651 | (!arg1 || !arg2) ? |
| 652 | errhint("No operator matches the given name and argument type. " |
| 653 | "You might need to add an explicit type cast.") : |
| 654 | errhint("No operator matches the given name and argument types. " |
| 655 | "You might need to add explicit type casts."), |
| 656 | parser_errposition(pstate, location))); |
| 657 | } |
| 658 | |
| 659 | /* |
| 660 | * make_op() |
no test coverage detected