diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-07-24 11:23:27 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-07-24 11:23:27 -0400 |
commit | 278cb4341103e967189997985b09981a73e23a34 (patch) | |
tree | 0b80dc3966c48f71463ffa9c9f3e6184fa09e2ea /src/backend/optimizer/path/indxpath.c | |
parent | bbbd9121e63f9f7cf8cc86025d5d848fba477eb4 (diff) | |
download | postgresql-278cb4341103e967189997985b09981a73e23a34.tar.gz postgresql-278cb4341103e967189997985b09981a73e23a34.zip |
Be more consistent about errors for opfamily member lookup failures.
Add error checks in some places that were calling get_opfamily_member
or get_opfamily_proc and just assuming that the call could never fail.
Also, standardize the wording for such errors in some other places.
None of these errors are expected in normal use, hence they're just
elog not ereport. But they may be handy for diagnosing omissions in
custom opclasses.
Rushabh Lathia found the oversight in RelationBuildPartitionKey();
I found the others by grepping for all callers of these functions.
Discussion: https://postgr.es/m/CAGPqQf2R9Nk8htpv0FFi+FP776EwMyGuORpc9zYkZKC8sFQE3g@mail.gmail.com
Diffstat (limited to 'src/backend/optimizer/path/indxpath.c')
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index dedb9f521da..f35380391ad 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -3978,13 +3978,13 @@ adjust_rowcompare_for_index(RowCompareExpr *clause, expr_op = get_opfamily_member(opfam, lefttype, righttype, op_strategy); if (!OidIsValid(expr_op)) /* should not happen */ - elog(ERROR, "could not find member %d(%u,%u) of opfamily %u", + elog(ERROR, "missing operator %d(%u,%u) in opfamily %u", op_strategy, lefttype, righttype, opfam); if (!var_on_left) { expr_op = get_commutator(expr_op); if (!OidIsValid(expr_op)) /* should not happen */ - elog(ERROR, "could not find commutator of member %d(%u,%u) of opfamily %u", + elog(ERROR, "could not find commutator of operator %d(%u,%u) of opfamily %u", op_strategy, lefttype, righttype, opfam); } new_ops = lappend_oid(new_ops, expr_op); |