mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Wording cleanup for error messages. Also change can't -> cannot.
Standard English uses "may", "can", and "might" in different ways: may - permission, "You may borrow my rake." can - ability, "I can lift that log." might - possibility, "It might rain today." Unfortunately, in conversational English, their use is often mixed, as in, "You may use this variable to do X", when in fact, "can" is a better choice. Similarly, "It may crash" is better stated, "It might crash".
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.359 2007/01/12 19:34:41 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.360 2007/02/01 19:10:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -646,7 +646,7 @@ transformInsertStmt(ParseState *pstate, InsertStmt *stmt,
|
||||
if (selectQuery->into)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("INSERT ... SELECT may not specify INTO")));
|
||||
errmsg("INSERT ... SELECT cannot specify INTO")));
|
||||
|
||||
/*
|
||||
* Make the source be a subquery in the INSERT's rangetable, and add
|
||||
@ -1803,7 +1803,7 @@ transformIndexStmt(ParseState *pstate, IndexStmt *stmt)
|
||||
if (expression_returns_set(ielem->expr))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
||||
errmsg("index expression may not return a set")));
|
||||
errmsg("index expression cannot return a set")));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1892,7 +1892,7 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
|
||||
if (list_length(pstate->p_rtable) != 2) /* naughty, naughty... */
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("rule WHERE condition may not contain references to other relations")));
|
||||
errmsg("rule WHERE condition cannot contain references to other relations")));
|
||||
|
||||
/* aggregates not allowed (but subselects are okay) */
|
||||
if (pstate->p_hasAggs)
|
||||
@ -1967,7 +1967,7 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
|
||||
stmt->whereClause != NULL)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("rules with WHERE conditions may only have SELECT, INSERT, UPDATE, or DELETE actions")));
|
||||
errmsg("rules with WHERE conditions can only have SELECT, INSERT, UPDATE, or DELETE actions")));
|
||||
|
||||
/*
|
||||
* If the action is INSERT...SELECT, OLD/NEW have been pushed down
|
||||
@ -2003,11 +2003,11 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
|
||||
if (has_old)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("ON SELECT rule may not use OLD")));
|
||||
errmsg("ON SELECT rule cannot use OLD")));
|
||||
if (has_new)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("ON SELECT rule may not use NEW")));
|
||||
errmsg("ON SELECT rule cannot use NEW")));
|
||||
break;
|
||||
case CMD_UPDATE:
|
||||
/* both are OK */
|
||||
@ -2016,13 +2016,13 @@ transformRuleStmt(ParseState *pstate, RuleStmt *stmt,
|
||||
if (has_old)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("ON INSERT rule may not use OLD")));
|
||||
errmsg("ON INSERT rule cannot use OLD")));
|
||||
break;
|
||||
case CMD_DELETE:
|
||||
if (has_new)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("ON DELETE rule may not use NEW")));
|
||||
errmsg("ON DELETE rule cannot use NEW")));
|
||||
break;
|
||||
default:
|
||||
elog(ERROR, "unrecognized event type: %d",
|
||||
@ -2663,7 +2663,7 @@ transformSetOperationTree(ParseState *pstate, SelectStmt *stmt)
|
||||
if (contain_vars_of_level((Node *) selectQuery, 1))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
|
||||
errmsg("UNION/INTERSECT/EXCEPT member statement may not refer to other relations of same query level")));
|
||||
errmsg("UNION/INTERSECT/EXCEPT member statement cannot refer to other relations of same query level")));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2987,7 +2987,7 @@ transformReturningList(ParseState *pstate, List *returningList)
|
||||
if (list_length(pstate->p_rtable) != length_rtable)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("RETURNING may not contain references to other relations")));
|
||||
errmsg("RETURNING cannot contain references to other relations")));
|
||||
|
||||
/* mark column origins */
|
||||
markTargetListOrigins(pstate, rlist);
|
||||
@ -3206,7 +3206,7 @@ transformDeclareCursorStmt(ParseState *pstate, DeclareCursorStmt *stmt)
|
||||
if (((Query *) stmt->query)->into)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_CURSOR_DEFINITION),
|
||||
errmsg("DECLARE CURSOR may not specify INTO")));
|
||||
errmsg("DECLARE CURSOR cannot specify INTO")));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user