Improve error message wording
The wording changes applied in 0ac5ad513
were universally disliked.
Per gripe from Andrew Dunstan
This commit is contained in:
parent
ab0f7b6089
commit
cb9b66d31a
|
@ -191,7 +191,7 @@ ERROR: cannot change foreign table "agg_csv"
|
||||||
DELETE FROM agg_csv WHERE a = 100;
|
DELETE FROM agg_csv WHERE a = 100;
|
||||||
ERROR: cannot change foreign table "agg_csv"
|
ERROR: cannot change foreign table "agg_csv"
|
||||||
SELECT * FROM agg_csv FOR UPDATE OF agg_csv;
|
SELECT * FROM agg_csv FOR UPDATE OF agg_csv;
|
||||||
ERROR: SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE cannot be used with foreign table "agg_csv"
|
ERROR: row-level locks cannot be used with foreign table "agg_csv"
|
||||||
LINE 1: SELECT * FROM agg_csv FOR UPDATE OF agg_csv;
|
LINE 1: SELECT * FROM agg_csv FOR UPDATE OF agg_csv;
|
||||||
^
|
^
|
||||||
-- but this should be ignored
|
-- but this should be ignored
|
||||||
|
|
|
@ -883,7 +883,7 @@ make_outerjoininfo(PlannerInfo *root,
|
||||||
(jointype == JOIN_FULL && bms_is_member(rc->rti, left_rels)))
|
(jointype == JOIN_FULL && bms_is_member(rc->rti, left_rels)))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE cannot be applied to the nullable side of an outer join")));
|
errmsg("row-level locks cannot be applied to the nullable side of an outer join")));
|
||||||
}
|
}
|
||||||
|
|
||||||
sjinfo->syn_lefthand = left_rels;
|
sjinfo->syn_lefthand = left_rels;
|
||||||
|
|
|
@ -1071,7 +1071,7 @@ grouping_planner(PlannerInfo *root, double tuple_fraction)
|
||||||
if (parse->rowMarks)
|
if (parse->rowMarks)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE is not allowed with UNION/INTERSECT/EXCEPT")));
|
errmsg("row-level locks are not allowed with UNION/INTERSECT/EXCEPT")));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate pathkeys that represent result ordering requirements
|
* Calculate pathkeys that represent result ordering requirements
|
||||||
|
|
|
@ -2149,31 +2149,31 @@ CheckSelectLocking(Query *qry)
|
||||||
if (qry->setOperations)
|
if (qry->setOperations)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/FOR KEY UPDATE/FOR KEY SHARE is not allowed with UNION/INTERSECT/EXCEPT")));
|
errmsg("row-level locks are not allowed with UNION/INTERSECT/EXCEPT")));
|
||||||
if (qry->distinctClause != NIL)
|
if (qry->distinctClause != NIL)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/FOR KEY UPDATE/FOR KEY SHARE is not allowed with DISTINCT clause")));
|
errmsg("row-level locks are not allowed with DISTINCT clause")));
|
||||||
if (qry->groupClause != NIL)
|
if (qry->groupClause != NIL)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/FOR KEY UPDATE/FOR KEY SHARE is not allowed with GROUP BY clause")));
|
errmsg("row-level locks are not allowed with GROUP BY clause")));
|
||||||
if (qry->havingQual != NULL)
|
if (qry->havingQual != NULL)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/FOR KEY UPDATE/FOR KEY SHARE is not allowed with HAVING clause")));
|
errmsg("row-level locks are not allowed with HAVING clause")));
|
||||||
if (qry->hasAggs)
|
if (qry->hasAggs)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/FOR KEY UPDATE/FOR KEY SHARE is not allowed with aggregate functions")));
|
errmsg("row-level locks are not allowed with aggregate functions")));
|
||||||
if (qry->hasWindowFuncs)
|
if (qry->hasWindowFuncs)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/FOR KEY UPDATE/FOR KEY SHARE is not allowed with window functions")));
|
errmsg("row-level locks are not allowed with window functions")));
|
||||||
if (expression_returns_set((Node *) qry->targetList))
|
if (expression_returns_set((Node *) qry->targetList))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/FOR KEY UPDATE/FOR KEY SHARE is not allowed with set-returning functions in the target list")));
|
errmsg("row-level locks are not allowed with set-returning functions in the target list")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2252,7 +2252,7 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc,
|
||||||
if (thisrel->catalogname || thisrel->schemaname)
|
if (thisrel->catalogname || thisrel->schemaname)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE must specify unqualified relation names"),
|
errmsg("row-level locks must specify unqualified relation names"),
|
||||||
parser_errposition(pstate, thisrel->location)));
|
parser_errposition(pstate, thisrel->location)));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -2269,7 +2269,7 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc,
|
||||||
if (rte->relkind == RELKIND_FOREIGN_TABLE)
|
if (rte->relkind == RELKIND_FOREIGN_TABLE)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE cannot be used with foreign table \"%s\"",
|
errmsg("row-level locks cannot be used with foreign table \"%s\"",
|
||||||
rte->eref->aliasname),
|
rte->eref->aliasname),
|
||||||
parser_errposition(pstate, thisrel->location)));
|
parser_errposition(pstate, thisrel->location)));
|
||||||
applyLockingClause(qry, i,
|
applyLockingClause(qry, i,
|
||||||
|
@ -2288,25 +2288,25 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc,
|
||||||
case RTE_JOIN:
|
case RTE_JOIN:
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE cannot be applied to a join"),
|
errmsg("row-level locks cannot be applied to a join"),
|
||||||
parser_errposition(pstate, thisrel->location)));
|
parser_errposition(pstate, thisrel->location)));
|
||||||
break;
|
break;
|
||||||
case RTE_FUNCTION:
|
case RTE_FUNCTION:
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE cannot be applied to a function"),
|
errmsg("row-level locks cannot be applied to a function"),
|
||||||
parser_errposition(pstate, thisrel->location)));
|
parser_errposition(pstate, thisrel->location)));
|
||||||
break;
|
break;
|
||||||
case RTE_VALUES:
|
case RTE_VALUES:
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE cannot be applied to VALUES"),
|
errmsg("row-level locks cannot be applied to VALUES"),
|
||||||
parser_errposition(pstate, thisrel->location)));
|
parser_errposition(pstate, thisrel->location)));
|
||||||
break;
|
break;
|
||||||
case RTE_CTE:
|
case RTE_CTE:
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE cannot be applied to a WITH query"),
|
errmsg("row-level locks cannot be applied to a WITH query"),
|
||||||
parser_errposition(pstate, thisrel->location)));
|
parser_errposition(pstate, thisrel->location)));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -2320,7 +2320,7 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc,
|
||||||
if (rt == NULL)
|
if (rt == NULL)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_UNDEFINED_TABLE),
|
(errcode(ERRCODE_UNDEFINED_TABLE),
|
||||||
errmsg("relation \"%s\" in FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE clause not found in FROM clause",
|
errmsg("relation \"%s\" in row-level lock clause not found in FROM clause",
|
||||||
thisrel->relname),
|
thisrel->relname),
|
||||||
parser_errposition(pstate, thisrel->location)));
|
parser_errposition(pstate, thisrel->location)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue