git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3353583)
Improve error message when an FDW doesn't support WHERE CURRENT OF.
2013年4月19日 20:14:56 +0000 (16:14 -0400)
2013年4月19日 20:14:56 +0000 (16:14 -0400)
If an FDW fails to take special measures with a CurrentOfExpr, we will
end up trying to execute it as an ordinary qual, which was being treated
as a purely internal failure condition. Provide a more user-oriented
error message for such cases.


diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 330d889eba9ef4ce07041dc87348a1c16fc084e2..4ea0cbadadbc14614d5e8182ec1da0ded631ee0f 100644 (file)
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -4257,16 +4257,20 @@ ExecEvalArrayCoerceExpr(ArrayCoerceExprState *astate,
/* ----------------------------------------------------------------
* ExecEvalCurrentOfExpr
*
- * The planner must convert CURRENT OF into a TidScan qualification.
- * So, we have to be able to do ExecInitExpr on a CurrentOfExpr,
- * but we shouldn't ever actually execute it.
+ * The planner should convert CURRENT OF into a TidScan qualification, or some
+ * other special handling in a ForeignScan node. So we have to be able to do
+ * ExecInitExpr on a CurrentOfExpr, but we shouldn't ever actually execute it.
+ * If we get here, we suppose we must be dealing with CURRENT OF on a foreign
+ * table whose FDW doesn't handle it, and complain accordingly.
* ----------------------------------------------------------------
*/
static Datum
ExecEvalCurrentOfExpr(ExprState *exprstate, ExprContext *econtext,
bool *isNull, ExprDoneCond *isDone)
{
- elog(ERROR, "CURRENT OF cannot be executed");
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("WHERE CURRENT OF is not supported for this table type")));
return 0; /* keep compiler quiet */
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /