Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6e481eb

Browse files
committed
Improve error message when an FDW doesn't support WHERE CURRENT OF.
If an FDW fails to take special measures with a CurrentOfExpr, we willend up trying to execute it as an ordinary qual, which was being treatedas a purely internal failure condition. Provide a more user-orientederror message for such cases.
1 parent3353583 commit6e481eb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎src/backend/executor/execQual.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4257,16 +4257,20 @@ ExecEvalArrayCoerceExpr(ArrayCoerceExprState *astate,
42574257
/* ----------------------------------------------------------------
42584258
*ExecEvalCurrentOfExpr
42594259
*
4260-
* The planner must convert CURRENT OF into a TidScan qualification.
4261-
* So, we have to be able to do ExecInitExpr on a CurrentOfExpr,
4262-
* but we shouldn't ever actually execute it.
4260+
* The planner should convert CURRENT OF into a TidScan qualification, or some
4261+
* other special handling in a ForeignScan node. So we have to be able to do
4262+
* ExecInitExpr on a CurrentOfExpr, but we shouldn't ever actually execute it.
4263+
* If we get here, we suppose we must be dealing with CURRENT OF on a foreign
4264+
* table whose FDW doesn't handle it, and complain accordingly.
42634265
* ----------------------------------------------------------------
42644266
*/
42654267
staticDatum
42664268
ExecEvalCurrentOfExpr(ExprState*exprstate,ExprContext*econtext,
42674269
bool*isNull,ExprDoneCond*isDone)
42684270
{
4269-
elog(ERROR,"CURRENT OF cannot be executed");
4271+
ereport(ERROR,
4272+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
4273+
errmsg("WHERE CURRENT OF is not supported for this table type")));
42704274
return0;/* keep compiler quiet */
42714275
}
42724276

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp