1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-12 21:01:52 +03:00

Tweak FOR UPDATE/SHARE error message wording (again)

In commit 0ac5ad5134 I changed some error messages from "FOR
UPDATE/SHARE" to a rather long gobbledygook which nobody liked.  Then,
in commit cb9b66d31 I changed them again, but the alternative chosen
there was deemed suboptimal by Peter Eisentraut, who in message
1373937980.20441.8.camel@vanquo.pezone.net proposed an alternative
involving a dynamically-constructed string based on the actual locking
strength specified in the SQL command.  This patch implements that
suggestion.
This commit is contained in:
Alvaro Herrera
2013-07-23 14:03:09 -04:00
parent 765ad89be3
commit c359a1b082
4 changed files with 118 additions and 22 deletions

View File

@ -1107,7 +1107,11 @@ grouping_planner(PlannerInfo *root, double tuple_fraction)
if (parse->rowMarks)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("row-level locks are not allowed with UNION/INTERSECT/EXCEPT")));
/*------
translator: %s is a SQL row locking clause such as FOR UPDATE */
errmsg("%s is not allowed with UNION/INTERSECT/EXCEPT",
LCS_asString(((RowMarkClause *)
linitial(parse->rowMarks))->strength))));
/*
* Calculate pathkeys that represent result ordering requirements