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/pathkeys.c | |
| parent | bbbd9121e63f9f7cf8cc86025d5d848fba477eb4 (diff) | |
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/pathkeys.c')
| -rw-r--r-- | src/backend/optimizer/path/pathkeys.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c index 37cfa098d49..9d83a5ca62b 100644 --- a/src/backend/optimizer/path/pathkeys.c +++ b/src/backend/optimizer/path/pathkeys.c @@ -197,8 +197,8 @@ make_pathkey_from_sortinfo(PlannerInfo *root, opcintype, BTEqualStrategyNumber); if (!OidIsValid(equality_op)) /* shouldn't happen */ - elog(ERROR, "could not find equality operator for opfamily %u", - opfamily); + elog(ERROR, "missing operator %d(%u,%u) in opfamily %u", + BTEqualStrategyNumber, opcintype, opcintype, opfamily); opfamilies = get_mergejoin_opfamilies(equality_op); if (!opfamilies) /* certainly should find some */ elog(ERROR, "could not find opfamilies for equality operator %u", |
