aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2017-03-20 16:01:45 -0400
committerAndrew Dunstan <andrew@dunslane.net>2017-03-20 16:01:45 -0400
commit839cb0649a9f595a8534cdf14afbe89efb1757b1 (patch)
tree9c41c0657d1c84196939be9f80e6192ecb5d0792 /src
parent9abbf4727de746222ad8fc15b17348065389ae43 (diff)
downloadpostgresql-839cb0649a9f595a8534cdf14afbe89efb1757b1.tar.gz
postgresql-839cb0649a9f595a8534cdf14afbe89efb1757b1.zip
Use a consistent error message style for user mappings.
User mappings are essentially anonymous, so messages referring to "user mapping foo on server bar" are wrong, and inconsistent with other error messages referring to user mappings. To be consistent with existing use, use "user mapping for foo on server bar" instead. I dropped the noise word "user" from the original suggestion to be consistent with other uses. Discussion: http://postgr.es/m/56c6f8ab-b2d6-f1fa-deb0-1d18cf67f7b9@2ndQuadrant.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/foreigncmds.c8
-rw-r--r--src/test/regress/expected/foreign_data.out8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c
index d5d40e62392..7f551149d2d 100644
--- a/src/backend/commands/foreigncmds.c
+++ b/src/backend/commands/foreigncmds.c
@@ -1155,7 +1155,7 @@ CreateUserMapping(CreateUserMappingStmt *stmt)
if (OidIsValid(umId))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
- errmsg("user mapping \"%s\" already exists for server %s",
+ errmsg("user mapping for \"%s\" already exists for server %s",
MappingUserName(useId),
stmt->servername)));
@@ -1247,7 +1247,7 @@ AlterUserMapping(AlterUserMappingStmt *stmt)
if (!OidIsValid(umId))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("user mapping \"%s\" does not exist for the server",
+ errmsg("user mapping for \"%s\" does not exist for the server",
MappingUserName(useId))));
user_mapping_ddl_aclcheck(useId, srv->serverid, stmt->servername);
@@ -1362,12 +1362,12 @@ RemoveUserMapping(DropUserMappingStmt *stmt)
if (!stmt->missing_ok)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("user mapping \"%s\" does not exist for the server",
+ errmsg("user mapping for \"%s\" does not exist for the server",
MappingUserName(useId))));
/* IF EXISTS specified, just note it */
ereport(NOTICE,
- (errmsg("user mapping \"%s\" does not exist for the server, skipping",
+ (errmsg("user mapping for \"%s\" does not exist for the server, skipping",
MappingUserName(useId))));
return InvalidOid;
}
diff --git a/src/test/regress/expected/foreign_data.out b/src/test/regress/expected/foreign_data.out
index a0f969f3e52..328366bcfc7 100644
--- a/src/test/regress/expected/foreign_data.out
+++ b/src/test/regress/expected/foreign_data.out
@@ -556,7 +556,7 @@ CREATE USER MAPPING FOR current_user SERVER s1; -- ERROR
ERROR: server "s1" does not exist
CREATE USER MAPPING FOR current_user SERVER s4;
CREATE USER MAPPING FOR user SERVER s4; -- ERROR duplicate
-ERROR: user mapping "regress_foreign_data_user" already exists for server s4
+ERROR: user mapping for "regress_foreign_data_user" already exists for server s4
CREATE USER MAPPING FOR public SERVER s4 OPTIONS ("this mapping" 'is public');
CREATE USER MAPPING FOR user SERVER s8 OPTIONS (username 'test', password 'secret'); -- ERROR
ERROR: invalid option "username"
@@ -596,7 +596,7 @@ ERROR: role "regress_test_missing_role" does not exist
ALTER USER MAPPING FOR user SERVER ss4 OPTIONS (gotcha 'true'); -- ERROR
ERROR: server "ss4" does not exist
ALTER USER MAPPING FOR public SERVER s5 OPTIONS (gotcha 'true'); -- ERROR
-ERROR: user mapping "public" does not exist for the server
+ERROR: user mapping for "public" does not exist for the server
ALTER USER MAPPING FOR current_user SERVER s8 OPTIONS (username 'test'); -- ERROR
ERROR: invalid option "username"
HINT: Valid options in this context are: user, password
@@ -626,13 +626,13 @@ ERROR: role "regress_test_missing_role" does not exist
DROP USER MAPPING FOR user SERVER ss4;
ERROR: server "ss4" does not exist
DROP USER MAPPING FOR public SERVER s7; -- ERROR
-ERROR: user mapping "public" does not exist for the server
+ERROR: user mapping for "public" does not exist for the server
DROP USER MAPPING IF EXISTS FOR regress_test_missing_role SERVER s4;
NOTICE: role "regress_test_missing_role" does not exist, skipping
DROP USER MAPPING IF EXISTS FOR user SERVER ss4;
NOTICE: server does not exist, skipping
DROP USER MAPPING IF EXISTS FOR public SERVER s7;
-NOTICE: user mapping "public" does not exist for the server, skipping
+NOTICE: user mapping for "public" does not exist for the server, skipping
CREATE USER MAPPING FOR public SERVER s8;
SET ROLE regress_test_role;
DROP USER MAPPING FOR public SERVER s8; -- ERROR